BazaarLinkBazaarLink
Sign in
DocsAPI ReferenceSDK ReferenceAgentic UsageAI Skills
Responses API

Create a response

Requests a model response using the OpenAI Responses API request shape (input/instructions); internally converted to Chat Completions format and routed to any supported model — this is a translation layer, not a separate inference path. This is a stateless endpoint: passing store: true or a non-null previous_response_id returns 400 (see the 400 entry below for its distinct error shape) — every call must carry the full conversation in input. When streaming, reasoning is surfaced via response.reasoning_text.delta events and a type:"reasoning" output item.

POST/v1/responses

Authorizations

Authorizationrequired
string · header

API key as bearer token in the Authorization header.

Body

modelrequired
string

The model to use, provider-qualified, e.g. "openai/gpt-5.4".

minLength: 1
Example: "openai/gpt-5.4"
inputrequired
string | InputItem[]

Conversation input — either a single string, or a structured array of items (message/function_call/function_call_output). Messages may use plain text or a content-block array including input_image.

instructions
string

System-level instructions, inserted as the first system message at the front of the converted messages array.

stream
boolean

true streams the response as Responses-API SSE events (response.created, response.output_item.added, response.output_text.delta, response.reasoning_text.delta, response.completed, and others); omitted or false returns a single JSON response.

max_output_tokens
integer

Maximum number of tokens the response may generate (converted to the upstream Chat Completions max_tokens).

tools
Tool[]

List of tool/function definitions the model may call. Accepts the Responses-spec flat shape {type:"function", name, description, parameters} (recommended), and also the Chat Completions nested shape {type:"function", function:{...}} (accepted for back-compat, passed through as-is). The response object's tools field echoes whatever was actually sent here.

tool_choice
string | object

Controls whether/how the model is forced to call a tool, e.g. {type:"function", name:"..."} (flat shape, recommended, auto-converted for upstream) or "auto". The response object's tool_choice field echoes whatever was sent here, defaulting to "auto" when omitted.

parallel_tool_calls
boolean

Whether to allow parallel tool calls when tools are provided. Defaults to true when omitted; the response object's parallel_tool_calls field echoes whatever was sent here.

plugins
object[]

Array of plugins (e.g. {id:"web"} to enable web search). Supported only on some model routes, with no effect elsewhere; :online enables web search on supported routes. Web search requested through plugins, :online, or web_search_options may incur an upstream add-on charge on the key used: BazaarLink's platform key or your BYOK key.

store
boolean

⚠️ This endpoint is stateless — passing true returns 400 immediately, it is never accepted or silently ignored. Omitting it or passing false is the only valid usage.

previous_response_id
string

⚠️ This endpoint is stateless — passing any non-null value returns 400 immediately, it is never accepted or silently ignored. To continue a conversation, send the full history in the input array instead.

models
string[]

Fallback model list — tried in order, only used once the primary model's own candidate group is exhausted. Each fallback is resolved through BazaarLink routing and billed at BazaarLink's customer price for that model; the list is not forwarded upstream.

reasoning
object

Reasoning-model thinking control object (e.g. {effort, max_tokens}), forwarded as-is upstream — no defaults are injected.

reasoning_effort
string

Flat shorthand for reasoning.effort.

lowmediumhigh
thinking
object

Claude extended-thinking's additive token budget (e.g. {type:"enabled", budget_tokens:2048}), on top of max_output_tokens — forwarded as-is, no defaults injected.

enable_thinking
boolean

Thinking on/off toggle for Qwen3/GLM-family models, forwarded as-is.

POST /v1/responses
curl https://api.bazaarlink.ai/v1/responses \
  -H "Authorization: Bearer $BAZAARLINK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.4",
    "input": "What is the capital of France?"
  }'
Response examples

BazaarLink returns a standardized response and removes upstream-specific fields. usage.cost and usage.bz_cost are the same USD amount charged to the customer for this request. Use the opaque BazaarLink request id from the response id or x-request-id with GET /v1/generation; non-streaming responses also return it in x-generation-id. Stats may take a few seconds after completion; retry a 404 briefly. Long non-streaming Chat, Messages, and Responses requests (about 12 seconds or longer) may start with whitespace keep-alive padding before the JSON body. Standard JSON parsers accept leading whitespace.

{
  "id": "85e6f35c71a31f19-SJC",
  "object": "response",
  "created_at": 1753500000,
  "completed_at": 1753500002,
  "status": "completed",
  "model": "openai/gpt-5.4",
  "output": [
    {
      "type": "reasoning",
      "id": "bazaarlink-reasoning-item-id",
      "status": "completed",
      "summary": [],
      "content": [
        {
          "type": "reasoning_text",
          "text": "The user is asking a simple geography fact..."
        }
      ]
    },
    {
      "type": "message",
      "id": "bazaarlink-message-item-id",
      "role": "assistant",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "text": "The capital of France is Paris.",
          "annotations": []
        }
      ]
    }
  ],
  "usage": {
    "input_tokens": 14,
    "output_tokens": 32,
    "total_tokens": 46,
    "cost": 0.00021,
    "bz_cost": 0.00021,
    "output_tokens_details": {
      "reasoning_tokens": 18
    }
  },
  "error": null,
  "incomplete_details": null,
  "tool_choice": "auto",
  "tools": [],
  "truncation": "auto",
  "parallel_tool_calls": true,
  "metadata": {},
  "store": false
}
Support
Support
Hi! How can we help you?
Send a message and we'll get back to you soon.
Create a response — BazaarLink API