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/api/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.2".

minLength: 1
Example: "openai/gpt-5.2"
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, no effect elsewhere; the :online model variant auto-injects {id:"web"} only when you didn't send any plugins, likewise only on supporting routes.

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.

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

Success. By default (or stream: false) returns the Response object below; with stream: true, returns the Responses API's SSE event stream instead. model always echoes the name you requested. output[] is composed of whatever was actually produced: a type:"reasoning" item first when reasoning content was present, followed by a type:"message" text item (its content's annotations array may carry citation sources, e.g. url_citation from a web search hit), or a type:"function_call" item. usage is converted from the underlying Chat Completions usage (input_tokens/output_tokens/total_tokens/cost), with an additional output_tokens_details.reasoning_tokens when reasoning tokens were used. tool_choice/tools/parallel_tool_calls echo whatever you actually sent in the request.

{
  "id": "resp_6f2a1c9d8e7b4a3f9c1d2e3f",
  "object": "response",
  "created_at": 1753500000,
  "completed_at": 1753500002,
  "status": "completed",
  "model": "openai/gpt-5.2",
  "output": [
    {
      "type": "reasoning",
      "id": "rs_1a2b3c4d5e6f7a8b9c0d1e2f",
      "status": "completed",
      "summary": [],
      "content": [
        {
          "type": "reasoning_text",
          "text": "The user is asking a simple geography fact..."
        }
      ]
    },
    {
      "type": "message",
      "id": "msg_9f8e7d6c5b4a3f2e1d0c9b8a",
      "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,
    "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