Responses

POST /v1/responses

POSThttps://api.topbilling.in/v1/responsesscope chat:write

The OpenAI Responses API, for Codex CLI and client.responses.create in the official SDKs. It is stateless: send the whole conversation in input each time.

Authentication

Send your key as Authorization: Bearer tb_… or x-api-key: tb_…. See Authentication.

Parameters

modelstringrequired
A Top Billing model id from GET /v1/models.
inputstring | arrayrequired
A string, or items: message (roles user, developer, system, assistant; input_text and input_image parts), function_call and function_call_output.
instructionsstring
System instructions.
toolsarray
Function tools, flat: { type: "function", name, description, parameters }. Hosted tools are ignored.
tool_choicestring | object
auto, none, required or a named function.
max_output_tokensinteger
Upper bound on generated tokens; sizes the reservation.
temperature / top_pnumber
Sampling.
reasoning.effortstring
A hint for reasoning models; never rejected.
text.formatobject
json_schema for structured output, on models that support it.
streamboolean
Server-sent events: response.created … response.completed.
storeboolean
Accepted; responses are never stored, so it is reported as false.

Rejected with 400 unsupported_parameter: previous_response_id, conversation, background, prompt.

Request

shell
curl https://api.topbilling.in/v1/responses \
  -H "Authorization: Bearer $TB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "<model-id>", "input": "Hello"}'

Errors

The same as Chat, except that an empty wallet or a spend cap answers 429 insufficient_quota, which is what OpenAI returns and what Codex stops on. A failure mid-stream arrives as a response.failed event.