Playground
Run one chat completion for the signed-in caller.
Streaming and non-streaming both, identically to POST /api/v1/chat/completions: this resolves the principal and then calls the very same handler. The request is billed to the caller's own attribution user in the workspace they named (or their organization's default), against that user's budget, and writes the ordinary usage row with no api_key_id, because there was no key.
The body is ChatCompletionRequest unchanged, so the page sends the same request an SDK would and a model, tool or parameter the gateway gains is available here the day it lands. The workspace rides in the query string rather than in the body for that reason: a field added to the body would also have to be added to the pipeline's strip list, and a gateway-internal field that is not stripped is forwarded to the provider as a call kwarg.
user and safety_identifier in the body are the fields the pipeline will not read here: spend and the provider's end-user identifier both bind to the session's own attribution user, derived and never accepted.
Enter your API key here (sent as Otari-Key header).
Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.
OpenAI-compatible chat completion request.
The completion-param fields are derived from any-llm's CompletionParams
(see _schema_derive) so the schema cannot silently drop a param any-llm
forwards. Fields below either tighten a derived field (messages,
response_format), add gateway-internal behavior (mcp_servers,
mcp_server_ids, guardrails, tools_header,
max_tool_iterations) that is stripped before the request is forwarded
upstream, or restate a derived field unchanged to document it
(max_completion_tokens), which is only worth doing where the wire
contract is not guessable from the field itself.
Upper bound on generated tokens. OpenAI's current name for the cap max_tokens used to carry; either field is accepted, and this one wins when a request sends both.
autoPossible values: A stable identifier for the end user behind the request, used as the tag the provider's end-user identifier is derived from. Wins over user for that, and is never sent upstream. The dashboard's Playground ignores it.
Optional caller-supplied label for a run, experiment or conversation, which names the session the request's trace is grouped under. Stripped before the request is forwarded upstream to the provider.
falseOptional override for the lead-in that the gateway prepends before the per-tool hint block in the system message. Useful for expressing global tool-selection policy (e.g. 'prefer MCP tools over code_execution'). Falls back to OTARI_TOOLS_HEADER env, then to the built-in default.
Successful Response
Validation Error
POST /api/v1/playground/chat/completions HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 1082
{
"frequency_penalty": 1,
"guardrails": [
{
"mode": "monitor",
"on": [
"input"
],
"on_unavailable": "block",
"profile": "text",
"url": "text",
"validate_kwargs": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}
],
"logit_bias": {
"ANY_ADDITIONAL_PROPERTY": 1
},
"logprobs": true,
"max_completion_tokens": 1,
"max_tokens": 1,
"max_tool_iterations": 1,
"mcp_server_ids": [
"123e4567-e89b-12d3-a456-426614174000"
],
"mcp_servers": [
{
"allowed_tools": [
"text"
],
"authorization_token": "text",
"name": "text",
"purpose_hint": "text",
"url": "text"
}
],
"messages": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
],
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"model": "text",
"n": 1,
"parallel_tool_calls": true,
"presence_penalty": 1,
"prompt_cache_key": "text",
"reasoning_effort": "auto",
"response_format": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"safety_identifier": "text",
"seed": 1,
"service_tier": "text",
"session_label": "text",
"stop": "text",
"stream": false,
"stream_options": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"temperature": 1,
"tool_choice": "text",
"tools": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
],
"tools_header": "text",
"top_logprobs": 1,
"top_p": 1,
"user": "text"
}No content
The caller's own rated comparisons in one workspace, newest first.
Without the two answer bodies: the list shows a dozen rows and renders neither, and there is no detail endpoint because the page has no screen that reads one back. A comparison is a judgment that was recorded, not a transcript to resume.
Enter your API key here (sent as Otari-Key header).
Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.
Successful Response
Validation Error
GET /api/v1/playground/comparisons HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
"data": [
{
"created_at": "2026-01-01T00:00:00.000Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"model_a": "text",
"model_b": "text",
"preference": "text",
"user_question": "text",
"workspace_id": "123e4567-e89b-12d3-a456-426614174000"
}
]
}Record which of two models answered a question better.
403 when comparison retention has not been granted; this is the flag with the wider disclosure, because the row keeps both models' full answers.
Enter your API key here (sent as Otari-Key header).
One rated A/B exchange.
Both answers in full, which is the disclosure the comparison consent flag covers: a preference with no answers attached is a datum nobody can later check, and the page's own history list shows the question and the two model ids from these columns.
Successful Response
A row in the comparison history: the question, the pair, the verdict.
Deliberately without the two answers. The list shows a dozen rows at once and none of them renders an answer body, so sending them would move megabytes to draw a few lines of text. There is no detail endpoint either, because the page has no screen that reads one back: a comparison is a judgment that was recorded, not a transcript to resume.
Validation Error
POST /api/v1/playground/comparisons HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 183
{
"model_a": "text",
"model_a_answer": "text",
"model_b": "text",
"model_b_answer": "text",
"preference": "model_a",
"user_question": "text",
"workspace_id": "123e4567-e89b-12d3-a456-426614174000"
}{
"created_at": "2026-01-01T00:00:00.000Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"model_a": "text",
"model_b": "text",
"preference": "text",
"user_question": "text",
"workspace_id": "123e4567-e89b-12d3-a456-426614174000"
}Delete one of the caller's saved comparisons.
Enter your API key here (sent as Otari-Key header).
Successful Response
No content
Validation Error
DELETE /api/v1/playground/comparisons/{comparison_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
No content
What the caller has agreed the Playground may store.
Both flags false for a caller who has never answered, and nothing is written: the page asks at the moment it needs the grant, so recording an answer on a page load would record one nobody gave.
Enter your API key here (sent as Otari-Key header).
Successful Response
What this identity has agreed the Playground may store.
Two flags rather than one, matching what the page asks for at the moment it asks: saving a transcript and recording a model preference are different disclosures (the second stores both models' full answers), and the old page asked about each separately at the point of use. An identity with no stored row reads back as both false.
falsefalseGET /api/v1/playground/consent HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
Successful Response
{
"store_comparisons": false,
"store_conversations": false
}Grant or withdraw content retention, one flag at a time.
An omitted flag is left as it was. Withdrawing blocks new saves and deletes nothing: what was stored with consent stays until its owner deletes it, which is what keeps a withdrawal from being a destructive action nobody asked for.
Enter your API key here (sent as Otari-Key header).
A partial update: an omitted flag is left as it was.
Tri-state on purpose. The page grants one flag at a time, just in time, so a request that carried both would silently re-assert the other, which is the wrong direction for a consent record to move on its own.
Successful Response
What this identity has agreed the Playground may store.
Two flags rather than one, matching what the page asks for at the moment it asks: saving a transcript and recording a model preference are different disclosures (the second stores both models' full answers), and the old page asked about each separately at the point of use. An identity with no stored row reads back as both false.
falsefalseValidation Error
PUT /api/v1/playground/consent HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 53
{
"store_comparisons": true,
"store_conversations": true
}{
"store_comparisons": false,
"store_conversations": false
}The caller's own saved transcripts in one workspace, newest first.
Not gated on consent: withdrawing it stops new saves, so a transcript saved while it was granted has to stay listable and deletable by its owner.
Enter your API key here (sent as Otari-Key header).
Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.
Successful Response
Validation Error
GET /api/v1/playground/conversations HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
"data": [
{
"created_at": "2026-01-01T00:00:00.000Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"message_count": 1,
"model": "text",
"title": "text",
"workspace_id": "123e4567-e89b-12d3-a456-426614174000"
}
]
}Save one transcript whole, for the caller, in a workspace they belong to.
403 when content retention has not been granted. The page asks first, so reaching that is a client that skipped the prompt: a consent gate enforced only in the browser is not a consent gate.
Enter your API key here (sent as Otari-Key header).
A transcript to save, whole: there is no append-a-turn endpoint.
The page saves on an explicit click, with the conversation it currently
shows, so the write is one row plus its turns and a resave is a new
conversation rather than a mutation of the old one. That is also what keeps
the ordering column honest: position is assigned here, from the list's
own order, and never negotiated with a client over several requests.
Successful Response
A row in the history list: enough to recognize, not the transcript.
Validation Error
POST /api/v1/playground/conversations HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 213
{
"messages": [
{
"attachments": [
{
"bytes": 1,
"file_id": "text",
"filename": "text"
}
],
"content": "text",
"reasoning": "text",
"role": "user"
}
],
"model": "text",
"title": "text",
"workspace_id": "123e4567-e89b-12d3-a456-426614174000"
}{
"created_at": "2026-01-01T00:00:00.000Z",
"id": "123e4567-e89b-12d3-a456-426614174000",
"message_count": 1,
"model": "text",
"title": "text",
"workspace_id": "123e4567-e89b-12d3-a456-426614174000"
}Delete one of the caller's saved transcripts, and its turns with it.
Enter your API key here (sent as Otari-Key header).
Successful Response
No content
Validation Error
DELETE /api/v1/playground/conversations/{conversation_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
No content
One saved transcript's turns, in order.
404 for a transcript belonging to somebody else, the same answer an unknown id gets: the owner predicate is in the query, so the two are indistinguishable from here. An empty transcript is not a state a save can produce (the request requires at least one turn), so no rows means no row for this caller.
Enter your API key here (sent as Otari-Key header).
Successful Response
Validation Error
GET /api/v1/playground/conversations/{conversation_id}/messages HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
"data": [
{
"attachments": [
{
"bytes": 1,
"file_id": "text",
"filename": "text"
}
],
"content": "text",
"reasoning": "text",
"role": "text"
}
]
}The caller's pinned model keys in one workspace, in pinned order.
Stored rather than kept in the browser, so a pin follows the person to their other devices; that is what the hosted original did and what makes the Favorites group in every picker worth having.
Enter your API key here (sent as Otari-Key header).
Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.
Successful Response
The pin list, most recently pinned first.
Validation Error
GET /api/v1/playground/favorite-models HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
"model_keys": [
"text"
]
}Replace the caller's pin list for one workspace.
A replace rather than a toggle, because the order is part of the value and the client already holds the list it is rendering. Two tabs racing therefore resolve to one of the two lists rather than to an interleaving neither of them showed. Model keys are not validated against the catalog: a pinned model that leaves the catalog simply stops appearing in the picker, and refusing the write would make a stale pin unremovable.
Enter your API key here (sent as Otari-Key header).
Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.
The whole pin list, replacing whatever was stored.
A replace rather than a toggle endpoint, because the client already holds the list it is rendering and the order is part of it (a newly pinned model leads). Two tabs racing therefore resolve to one of the two lists rather than to an interleaving neither of them showed.
Successful Response
The pin list, most recently pinned first.
Validation Error
PUT /api/v1/playground/favorite-models HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 23
{
"model_keys": [
"text"
]
}{
"model_keys": [
"text"
]
}The caller's own files in one workspace, newest first, in OpenAI's list shape.
Every file the caller owns there is listed, including one uploaded with an API key of theirs in the same workspace, because a message here can attach it.
Enter your API key here (sent as Otari-Key header).
Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.
100Successful Response
A page of files in OpenAI's list shape, whose cursor is the last entry's ID.
listValidation Error
GET /api/v1/playground/files HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
"data": [
{
"bytes": 1,
"created_at": 1,
"expires_at": 1,
"filename": "text",
"id": "text",
"object": "file",
"purpose": "text"
}
],
"first_id": "text",
"has_more": true,
"last_id": "text",
"object": "list"
}Upload a file for the caller, in a workspace they belong to.
The row is owned by the same principal a Playground completion runs as, so a file_id returned here resolves in the caller's own messages and in nobody else's. POST /api/v1/files takes an API key, which a dashboard session does not hold; this is the session's way in.
Enter your API key here (sent as Otari-Key header).
Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.
Successful Response
One file in OpenAI's file object shape.
fileThe upload exceeds the configured maximum size.
Validation Error
POST /api/v1/playground/files HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 15
{
"file": "text"
}{
"bytes": 1,
"created_at": 1,
"expires_at": 1,
"filename": "text",
"id": "text",
"object": "file",
"purpose": "text"
}Delete one of the caller's files. Another identity's answers 404, as a nonexistent one does.
A saved transcript that attached the file keeps its record of the attachment, but the file is gone, so sending that turn again does not send its contents.
Enter your API key here (sent as Otari-Key header).
Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.
Successful Response
OpenAI's answer to a delete.
truefileValidation Error
DELETE /api/v1/playground/files/{file_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
"deleted": true,
"id": "text",
"object": "file"
}The gateway-run tools the caller's workspace may attach to a message.
One read rather than the three the dashboard would otherwise make (the deployment's tool settings, the workspace's web-search row, its code-execution row), because the answer is a composition of them in a fixed direction: the deployment decides whether a tool exists and the workspace may only narrow that. Composing it here is what keeps the menu from offering something the request path would refuse.
Enter your API key here (sent as Otari-Key header).
Workspace to act in. Defaults to the caller's organization's default workspace. A workspace the caller is not a member of answers 404, as a nonexistent one does.
Successful Response
What the caller's workspace may attach to a Playground message.
Validation Error
GET /api/v1/playground/tools HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
"code_execution": {
"configured": true,
"enabled": true,
"reason": "text"
},
"files": {
"configured": true,
"enabled": true,
"reason": "text"
},
"mcp_servers": [
{
"enabled": true,
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"purpose_hint": "text"
}
],
"web_search": {
"configured": true,
"enabled": true,
"reason": "text"
}
}Last updated
Was this helpful?
