API reference/Responses
Responses
An OpenAI Responses compatible endpoint and the format Codex uses by default. Input goes in the input field, output is an output array, and reasoning and tool calls are separate items.
https:/ / api.wokey.ai/ v1/ responses· OpenAI Responses compatibleOn this pageexpand_more
Examplelink
Set the base URL to https://api.wokey.ai/v1. For Codex setup, see the Codex page under Clients.
curl https://api.wokey.ai/v1/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6-sol",
"instructions": "You are a helpful assistant.",
"input": [
{ "role": "user", "content": "Hello" }
],
"reasoning": { "effort": "medium" },
"store": false
}'Headerslink
AuthorizationBearer YOUR_API_KEYRequired- Your Wokey API key.
x-api-key: YOUR_API_KEYworks as well. Content-Typeapplication/jsonRequired- The request body is JSON.
X-End-User-Idstring- Optional. Your end user's ID, 1–128 visible ASCII characters. With it, restrictions triggered by repeated violations apply only to that end user.
Request parameterslink
The parameters below are read by the gateway or change its behavior. Other parameters are forwarded as far as the chosen model's upstream supports them.
modelstringRequired- A non-empty model ID that exactly matches one in the model list.
inputstring | arrayRequired- The input: a text string, or an array of messages and items. This endpoint does not accept a
messagesfield; sending one returns 400. instructionsstring- System instructions. For GPT models the gateway fills in
"You are a helpful assistant."when it is missing. reasoningobject- For example
{"effort": "high", "summary": "auto"}. GPT defaults toeffortmedium. Claude models use onlyeffort, handled likereasoning_effortin Chat Completions;summaryhas no effect. streamboolean- When
true, the response streams as SSE events. toolsarray- Function tools and built-in tools such as
web_search.tool_choiceandparallel_tool_callsare supported too. textobject- Output format, for example a JSON Schema for structured output in
text.format. max_output_tokensinteger- GPT models do not support it and ignore it. Claude models receive it as
max_tokens, defaulting to 32000. Grok, DeepSeek, MiniMax, and similar models receive it as-is. storeboolean- Always treated as
falsefor GPT models; Wokey does not store conversations upstream. previous_response_idstring- Not supported. Because conversations are not stored upstream, every request must carry the full history in
input, which is what Codex does by default. includearray- For example
["reasoning.encrypted_content"]to get encrypted reasoning back. Put thosereasoningitems back into the next turn'sinputto continue the reasoning and hit the cache. prompt_cache_keystring- Cache key, up to 64 characters. Keeping it fixed within a session helps cache hits.
providerobject- A Wokey extension that picks or excludes vendors. It is used for routing only and is not forwarded upstream.
How Wokey handles itlink
What the gateway does before and after forwarding, and where it differs from calling the official API directly.
- GPT models are forwarded in Responses format without conversion. The main changes:
storeis alwaysfalse;user,safety_identifier,max_output_tokens, and sampling parameters are not forwarded;inputitems withrolesystembecomedeveloper. - Claude, DeepSeek, and other non-OpenAI models can also be called in this format. Claude called here does not support reasoning settings, and its
usagehas onlyinput_tokens,output_tokens, andtotal_tokens; use the Messages endpoint for Claude's full feature set. - POST
/v1/responses/input_tokenscounts a request's input tokens. POST/v1/responses/compactcompacts the context and supports GPT models only. - GET
/v1/responses(WebSocket mode) is not supported and returns 426websocket_not_supported. metadataandproviderare not forwarded upstream.
When a model has several vendors, add a provider object to the request body to pick or exclude vendors. Choosing vendors and their order →
Responselink
{
"id": "resp_...",
"object": "response",
"status": "completed",
"model": "gpt-6-sol",
"output": [
{ "type": "reasoning", "id": "rs_...", "summary": [] },
{
"type": "message",
"id": "msg_...",
"role": "assistant",
"content": [{ "type": "output_text", "text": "Hello! How can I help you today?" }]
}
],
"usage": {
"input_tokens": 21,
"input_tokens_details": { "cached_tokens": 0 },
"output_tokens": 42,
"output_tokens_details": { "reasoning_tokens": 32 },
"total_tokens": 63
}
}- The
x-wokey-request-idresponse header is the request's ID at Wokey. Include it when you report a problem. - The
outputarray lists reasoning, message, and tool call items in order. The SDKs'output_textjoins all the text. - GPT models:
input_tokensincludes cached tokens, with the cached count ininput_tokens_details.cached_tokens; reasoning tokens are inoutput_tokens_details.reasoning_tokens. - Claude models:
input_tokensexcludes cache, and no cache breakdown is returned.
Streaminglink
Each event has an event: line and a data: line; the last event is response.completed.
event: response.created
data: {"type":"response.created","response":{"id":"resp_...","status":"in_progress"}}
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_...","output_index":1,"delta":"Hello!"}
event: response.output_text.done
data: {"type":"response.output_text.done","item_id":"msg_...","output_index":1,"text":"Hello! How can I help you today?"}
event: response.completed
data: {"type":"response.completed","response":{"id":"resp_...","status":"completed","usage":{"input_tokens":21,"output_tokens":42,"total_tokens":63}}}- GPT models pass the upstream event stream through unchanged.
- For other models the gateway generates events in the Responses format, ending with
response.completedfollowed bydata: [DONE]. - An error during the stream is sent as a
response.failedevent. - While waiting for the first upstream byte, the gateway sends periodic SSE comment lines to keep the connection open, which clients ignore.
Error formatlink
{
"error": {
"code": "model_not_found",
"message": "Model ID \"gpt-6-sun\" was not recognized. The correct model ID is \"gpt-6-sol\"; use it and try again. See https://wokey.ai/models for the full list.",
"type": "invalid_request_error"
}
}Errors use the OpenAI shape: error.code is the code to branch on, and error.type is usually invalid_request_error. For what each status means and what to do, see Error codes & troubleshooting →