Responses
POST /v1/responses
POST
https://api.topbilling.in/v1/responsesscope chat:writeThe 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
modelstringrequiredA Top Billing model id from
GET /v1/models.inputstring | arrayrequiredA string, or items:
message (roles user, developer, system, assistant; input_text and input_image parts), function_call and function_call_output.instructionsstringSystem instructions.
toolsarrayFunction tools, flat:
{ type: "function", name, description, parameters }. Hosted tools are ignored.tool_choicestring | objectauto, none, required or a named function.
max_output_tokensintegerUpper bound on generated tokens; sizes the reservation.
temperature / top_pnumberSampling.
reasoning.effortstringA hint for reasoning models; never rejected.
text.formatobjectjson_schema for structured output, on models that support it.streambooleanServer-sent events:
response.created … response.completed.storebooleanAccepted; responses are never stored, so it is reported as
false.Rejected with 400 unsupported_parameter: previous_response_id, conversation, background, prompt.
Request
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.