Skip to main content

Responses API

POST https://gateway.primexos.com/v1/responses

The OpenAI Responses API, used by Codex CLI and OpenAI SDK "responses" mode. It supports agentic tool use (function, custom/grammar, and built-in tools like tool_search) that the chat endpoint cannot represent.

OpenAI-compatible

Accepts the standard OpenAI Responses parameters. Primex differences: authenticate with your prx- key, set model to a Primex model ID, and note that billable built-in tools are gated until metered (see Tool & Function Calling and Errors & Limits).

Passthrough vs rewrite​

How a /v1/responses request is handled depends on the model:

  • Responses-passthrough models: forwarded natively; the reply comes back in Responses shape (output[]). Check the live catalogue for native Responses support.
  • Chat-only models: a /responses request is rewritten to /chat/completions. Function/custom-only tool requests translate fine; requests carrying built-in Responses tools return a 400 (unsupported_responses_tools) telling you to use a passthrough model.
For Codex and agentic clients

Use a model marked for native Responses support. Codex's default wire_api = "responses" works out of the box with that model.

Request​

curl https://gateway.primexos.com/v1/responses \
-H "Authorization: Bearer prx-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"input": "Summarize the Primex gateway in one sentence."
}'

Response (shape)​

{
"id": "resp_…",
"object": "response",
"model": "gpt-5.5",
"output": [
{"type": "message", "role": "assistant",
"content": [{"type": "output_text", "text": "Primex is a metered AI gateway…"}]}
],
"usage": {"input_tokens": 18, "output_tokens": 16}
}