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

Responses

Create Response

post

OpenAI-compatible Responses endpoint.

Supports MCP tool-use loops, sandboxed code execution, and SearXNG web_search.

Authorizations
Otari-KeystringRequired

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

Header parameters
Idempotency-Keystring · nullableOptional

A unique value, such as a UUID, that makes a non-streaming request safe to retry. A retry with the same key and body returns the original response, request ID and cost without calling the provider or billing again. A retry while the original is still running is answered 409 with Retry-After. Reusing a key for a different body is refused with 422. Ignored for streaming requests and on a deployment without OTARI_SECRET_KEY, which encrypts the stored response.

Otari-Tagsstring · nullableOptional

Tags for cost attribution, as comma-separated key=value pairs (agent=bug-fix,run=1234), for a client that cannot set the body's metadata. Keys and values are percent-decoded, so either may carry an encoded , or =, and a non-ASCII character must be encoded. Whitespace around a pair is ignored, and a repeated header is read as one list. The bounds are the body's: up to 16 pairs, keys up to 64 characters and values up to 512, counted after merging with the body's tags, which win on the same key. Never forwarded to the provider.

Body

OpenAI Responses API-compatible request.

The wire fields are derived from any-llm's ResponsesParams (see _schema_derive) so the schema cannot silently drop a param any-llm forwards. Gateway-internal fields (mcp_servers, mcp_server_ids, guardrails, tools_header, max_tool_iterations) opt the request into gateway-managed MCP / sandbox / web_search / guardrails without changing the upstream wire shape. They're stripped before the request is forwarded.

backgroundboolean · nullableOptional
conversationany of · nullableOptional
stringOptional
or
frequency_penaltynumber · nullableOptional
includestring[] · nullableOptional
inputanyRequired
instructionsstring · nullableOptional
max_output_tokensinteger · nullableOptional
max_tool_callsinteger · nullableOptional
max_tool_iterationsinteger · min: 1 · max: 25 · nullableOptional
mcp_server_idsstring · uuid[] · max: 50 · nullableOptional
modelstringRequired
parallel_tool_callsboolean · nullableOptional
presence_penaltynumber · nullableOptional
previous_response_idstring · nullableOptional
prompt_cache_keystring · nullableOptional
prompt_cache_retentionstring · nullableOptional
safety_identifierstring · 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.

storeboolean · nullableOptional
streambooleanOptionalDefault: false
temperaturenumber · nullableOptional
textany · nullableOptional
tool_choiceany of · nullableOptional
stringOptional
or
tools_headerstring · nullableOptional
top_logprobsinteger · nullableOptional
top_pnumber · nullableOptional
truncationstring · nullableOptional
userstring · nullableOptional
Other propertiesanyOptional
Responses
200

Successful Response

application/json
anyOptional
post/api/v1/responses
POST /api/v1/responses HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 1267

{
  "background": true,
  "context_management": [
    {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ],
  "conversation": "text",
  "frequency_penalty": 1,
  "guardrails": [
    {
      "mode": "monitor",
      "on": [
        "input"
      ],
      "on_unavailable": "block",
      "profile": "text",
      "url": "text",
      "validate_kwargs": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    }
  ],
  "include": [
    "text"
  ],
  "input": null,
  "instructions": "text",
  "max_output_tokens": 1,
  "max_tool_calls": 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"
    }
  ],
  "metadata": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "model": "text",
  "parallel_tool_calls": true,
  "presence_penalty": 1,
  "previous_response_id": "text",
  "prompt_cache_key": "text",
  "prompt_cache_retention": "text",
  "reasoning": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "response_format": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "safety_identifier": "text",
  "service_tier": "text",
  "session_label": "text",
  "store": true,
  "stream": false,
  "stream_options": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "temperature": 1,
  "text": null,
  "tool_choice": "text",
  "tools": [
    {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ],
  "tools_header": "text",
  "top_logprobs": 1,
  "top_p": 1,
  "truncation": "text",
  "user": "text",
  "ANY_ADDITIONAL_PROPERTY": "anything"
}

No content

Last updated

Was this helpful?