For the complete documentation index, see llms.txt. This page is also available as Markdown.

Playground

Playground Chat Completions

post

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
workspace_idstring · uuid · nullableOptional

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.

Body

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.

frequency_penaltynumber · nullableOptional
logprobsboolean · nullableOptional
max_completion_tokensinteger · nullableOptional

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.

max_tokensinteger · nullableOptional
max_tool_iterationsinteger · min: 1 · max: 25 · nullableOptional
mcp_server_idsstring · uuid[] · max: 50 · nullableOptional
modelstringRequired
ninteger · nullableOptional
parallel_tool_callsboolean · nullableOptional
presence_penaltynumber · nullableOptional
prompt_cache_keystring · nullableOptional
reasoning_effortstring · enum · nullableOptionalDefault: autoPossible values:
safety_identifierstring · nullableOptional

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.

seedinteger · nullableOptional
service_tierstring · nullableOptional
session_labelstring · max: 255 · nullableOptional

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.

stopany of · nullableOptional
stringOptional
or
string[]Optional
streambooleanOptionalDefault: false
temperaturenumber · nullableOptional
tool_choiceany of · nullableOptional
stringOptional
or
tools_headerstring · max: 4000 · nullableOptional

Optional 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.

top_logprobsinteger · nullableOptional
top_pnumber · nullableOptional
userstring · nullableOptional
Responses
200

Successful Response

application/json
anyOptional
post/api/v1/playground/chat/completions
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

List Playground Comparisons

get

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
workspace_idstring · uuid · nullableOptional

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.

Responses
200

Successful Response

application/json
get/api/v1/playground/comparisons
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"
    }
  ]
}

Save Playground Comparison

post

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Body

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.

model_astring · max: 512Required
model_a_answerstring · max: 200000Required
model_bstring · max: 512Required
model_b_answerstring · max: 200000Required
preferencestring · enumRequiredPossible values:
user_questionstring · min: 1 · max: 200000Required
workspace_idstring · uuidRequired
Responses
201

Successful Response

application/json

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.

created_atstring · date-timeRequired
idstring · uuidRequired
model_astringRequired
model_bstringRequired
preferencestringRequired
user_questionstringRequired
workspace_idstring · uuidRequired
post/api/v1/playground/comparisons
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 Playground Comparison

delete

Delete one of the caller's saved comparisons.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
comparison_idstring · uuidRequired
Responses
204

Successful Response

No content

delete/api/v1/playground/comparisons/{comparison_id}
DELETE /api/v1/playground/comparisons/{comparison_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*

No content

get

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Responses
200

Successful Response

application/json

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.

store_comparisonsbooleanOptionalDefault: false
store_conversationsbooleanOptionalDefault: false
get/api/v1/playground/consent
GET /api/v1/playground/consent HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
200

Successful Response

{
  "store_comparisons": false,
  "store_conversations": false
}
put

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Body

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.

store_comparisonsboolean · nullableOptional
store_conversationsboolean · nullableOptional
Responses
200

Successful Response

application/json

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.

store_comparisonsbooleanOptionalDefault: false
store_conversationsbooleanOptionalDefault: false
put/api/v1/playground/consent
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
}

List Playground Conversations

get

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
workspace_idstring · uuid · nullableOptional

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.

Responses
200

Successful Response

application/json
get/api/v1/playground/conversations
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 Playground Conversation

post

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Body

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.

modelstring · max: 512Required
titlestring · min: 1 · max: 200Required
workspace_idstring · uuidRequired
Responses
201

Successful Response

application/json

A row in the history list: enough to recognize, not the transcript.

created_atstring · date-timeRequired
idstring · uuidRequired
message_countintegerRequired
modelstringRequired
titlestringRequired
workspace_idstring · uuidRequired
post/api/v1/playground/conversations
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 Playground Conversation

delete

Delete one of the caller's saved transcripts, and its turns with it.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
conversation_idstring · uuidRequired
Responses
204

Successful Response

No content

delete/api/v1/playground/conversations/{conversation_id}
DELETE /api/v1/playground/conversations/{conversation_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*

No content

Read Playground Conversation Messages

get

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
conversation_idstring · uuidRequired
Responses
200

Successful Response

application/json
get/api/v1/playground/conversations/{conversation_id}/messages
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"
    }
  ]
}

Read Playground Favorite Models

get

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
workspace_idstring · uuid · nullableOptional

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.

Responses
200

Successful Response

application/json

The pin list, most recently pinned first.

model_keysstring[]Required
get/api/v1/playground/favorite-models
GET /api/v1/playground/favorite-models HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
  "model_keys": [
    "text"
  ]
}

Replace Playground Favorite Models

put

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
workspace_idstring · uuid · nullableOptional

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.

Body

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.

model_keysstring[] · max: 50Required
Responses
200

Successful Response

application/json

The pin list, most recently pinned first.

model_keysstring[]Required
put/api/v1/playground/favorite-models
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"
  ]
}

List Playground Files

get

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
workspace_idstring · uuid · nullableOptional

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.

limitinteger · min: 1 · max: 1000OptionalDefault: 100
afterstring · nullableOptional
Responses
200

Successful Response

application/json

A page of files in OpenAI's list shape, whose cursor is the last entry's ID.

first_idstring · nullableRequired
has_morebooleanRequired
last_idstring · nullableRequired
objectconst: listOptionalDefault: list
get/api/v1/playground/files
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 Playground File

post

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
workspace_idstring · uuid · nullableOptional

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.

Body
filestringRequired
Responses
200

Successful Response

application/json

One file in OpenAI's file object shape.

bytesintegerRequired
created_atintegerRequired
expires_atinteger · nullableRequired
filenamestringRequired
idstringRequired
objectconst: fileOptionalDefault: file
purposestringRequired
post/api/v1/playground/files
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 Playground File

delete

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
file_idstringRequired
Query parameters
workspace_idstring · uuid · nullableOptional

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.

Responses
200

Successful Response

application/json

OpenAI's answer to a delete.

deletedconst: OptionalDefault: true
idstringRequired
objectconst: fileOptionalDefault: file
delete/api/v1/playground/files/{file_id}
DELETE /api/v1/playground/files/{file_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
  "deleted": true,
  "id": "text",
  "object": "file"
}

Read Playground Tools

get

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.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
workspace_idstring · uuid · nullableOptional

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.

Responses
200

Successful Response

application/json

What the caller's workspace may attach to a Playground message.

get/api/v1/playground/tools
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?