Call a workspace prompt

Portkey-style prompt call. The path names a prompt from the workspace's prompt library by id or slug; append @<version> to pin a version, otherwise the published version answers. The body carries variables, which must be exactly the prompt's, and any Chat Completions member except messages, which overrides what the prompt sets. Answered exactly as /v1/chat/completions, through the same key, limits, auto routing and usage; the request records the prompt and version.

post/v1/prompts/{promptId}/completions

Request

Path parameters

promptIdstring required

The prompt's id or slug, optionally followed by @<version>.

Headers

X-AgentLab-Routing'auto' | 'auto:cost' | 'auto:balanced' | 'auto:quality'

Let the Gateway choose the model although the body names one, with that preference.

Idempotency-Keystring

Request body

variablesobject

One string for each {{variable}} the prompt uses; a missing or extra one is refused with prompt_variables_mismatch.

modelstring

Overrides the prompt's model: auto or a name from GET /v1/models.

streamboolean
userstring

Recorded as the request's end user.

Response

The model's answer, or a text/event-stream when stream is true.

object required

Changes

No recorded changes to this operation across all 1 revision of this API.