palbaseDocs

Palbase ai · API

POST/ai/client/templates/{name}/run

Run a published server-locked AI template from a client app

Run a published server-locked AI template from a client app.

Called by your app, with the publishable key; or a signed-in user of your app, with their token and the publishable key; or your server, with the project's secret key.

Path

namestring · requiredTemplate slug name.

Request body

variablesobject · optionalTemplate variables validated against variables_schema.
streamboolean · optionalStream incremental tokens as SSE when true.
attachmentsobject[] · optionalOptional attachments bounded by template generation_limits.
curl
curl -X POST "https://<your-ref>.palbase.studio/ai/client/templates/<name>/run" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"variables":{},"stream":false,"attachments":[{"bucket":"string","data":"string","media_type":"string","path":"string","url":"https://example.com"}]}'

Responses

200Template answer (JSON, SSE stream, or audio bytes for tts)

400HTTP 400 error

401HTTP 401 error

402HTTP 402 error

403HTTP 403 error

404HTTP 404 error

429HTTP 429 error

503HTTP 503 error

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation RunClientTemplate of ai's contract.