CrossModel

Responses

POST /v1/responses

Send input to a model and get one complete response. The Responses endpoint organizes both input and output as structured "items", which keeps function-calling and multimodal flows cleaner.

This endpoint is compatible with the OpenAI Responses SDK. If you already have a project on the OpenAI SDK, just point base_url at CrossModel and set model to a CrossModel model ID — nothing else needs to change.

Endpoint

POST https://api.crossmodel.ai/v1/responses
Authorization: Bearer cm-YOUR_KEY
Content-Type: application/json

Every request must carry a Bearer API key in the Authorization header.

$
Create response
1curl https://api.crossmodel.ai/v1/responses \2  -H "Content-Type: application/json" \3  -H "Authorization: Bearer $CROSSMODEL_API_KEY" \4  -d '{5    "model": "openai/gpt-5-mini",6    "instructions": "You are a helpful assistant.",7    "input": "Hello!"8  }'

Request parameters

ParameterTypeRequiredNotes
modelstringYesThe model ID to use, e.g. openai/gpt-5-mini. Call /v1/models for the full list.
inputstring or arrayNoThe model input. Either a string, or an array of input items (see Input items).
instructionsstringNoSystem-level instructions that set the model's overall behavior; prepended to the input at the highest priority.
max_output_tokensintegerNoMax tokens to generate for this response.
temperaturenumberNoSampling temperature, typically 02. Higher is more random and varied.
top_pnumberNoNucleus-sampling threshold. Usually adjust either temperature or top_p, not both.
toolsarrayNoThe tools the model may call. See Function tools below.
tool_choicestring or objectNoControls whether and how the model calls tools: auto, none, required, or an object naming a specific function.
reasoningobjectNoReasoning config. effort controls how much reasoning the model spends before answering: none, minimal, low, medium, high, xhigh. The effect depends on whether the model is a reasoning model.
safety_identifierstringNoA stable identifier for your end user, for safety and abuse detection. Pass a hashed user ID.
metadataobjectNoCustom key-value pairs attached to the request.
streambooleanNoWhether to stream the result. Default false.
userstringNoLegacy alias for safety_identifier. When both are present, safety_identifier wins.

Input items

When input is a string, it's treated as one user message. When it's an array, each element is an input item with a type field:

typeFieldsNotes
messagerole, contentA message. role is user, assistant, system, or developer; content is a string or an array of content blocks.
function_callcall_id, name, argumentsA record of a function call. arguments is a JSON string.
function_call_outputcall_id, outputThe result of running a function; call_id points at the corresponding function_call.

When a message's content is an array, these content blocks are supported:

typeFieldsNotes
input_texttextText input.
input_imageimage_url, detailImage input. image_url can be a public image URL or a data:image/...;base64,... data URL.
input_filefile_id or file_urlFile input; supported on some models only.

Function tools

Declare functions the model can call via the tools field. The model returns a structured call request when needed.

{
  "tools": [
    {
      "type": "function",
      "name": "get_weather",
      "description": "Get current weather for a city.",
      "parameters": {
        "type": "object",
        "properties": {
          "city": { "type": "string" }
        },
        "required": ["city"]
      }
    }
  ]
}
FieldTypeRequiredNotes
typestringYesTool type; currently function.
namestringYesThe function name.
descriptionstringNoWhat the function does. A clear description helps the model decide when to call it.
parametersobjectNoJSON Schema for the function's parameters.
strictbooleanNoWhether to require the model to generate arguments strictly matching the schema.

The following fields — used for multi-turn state and other advanced behavior — aren't part of CrossModel's official support surface yet. Whether they work depends on the model: some accept them, others return an unsupported_responses_feature error. For cross-model portability, avoid relying on them: previous_response_id, conversation, store, background, include, prompt, prompt_cache_key, prompt_cache_retention, context_management, max_tool_calls, service_tier, verbosity, stream_options, parallel_tool_calls.

Example request

curl https://api.crossmodel.ai/v1/responses \
  -H "Authorization: Bearer cm-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5-mini",
    "instructions": "You are a helpful assistant.",
    "input": "Hello!"
  }'

Response

A non-streaming request returns a response object.

{
  "id": "resp_abc123",
  "object": "response",
  "status": "completed",
  "model": "openai/gpt-5-mini",
  "output": [
    {
      "type": "message",
      "id": "msg_abc123",
      "role": "assistant",
      "status": "completed",
      "content": [
        { "type": "output_text", "text": "Hello! How can I help?" }
      ]
    }
  ],
  "usage": {
    "input_tokens": 18,
    "output_tokens": 14,
    "total_tokens": 32
  }
}
FieldTypeNotes
idstringA unique ID for this response.
objectstringAlways response.
statusstringThe response status; completed on success.
modelstringThe model ID used for this request.
outputarrayThe generated output items.
usageobjectToken usage for this request, used for billing.

Output items

Each element of output is an item with a type field:

typeFieldsNotes
messageid, role, status, contentA generated message. content is an array of output_text blocks.
function_callid, call_id, name, arguments, statusA function call issued by the model. arguments is a JSON string.

The usage object

FieldTypeNotes
input_tokensintegerInput tokens.
output_tokensintegerOutput tokens.
input_tokens_details.cached_tokensintegerInput tokens that hit the cache.
output_tokens_details.reasoning_tokensintegerTokens spent on reasoning.
total_tokensintegerInput plus output tokens.

Streaming response

Set stream to true and the endpoint returns text/event-stream. Each event starts with data: and carries an event object with a type field:

EventNotes
response.createdThe response begins.
response.output_item.addedA new output item is added.
response.output_text.deltaAn incremental piece of text.
response.function_call_arguments.deltaAn incremental piece of function-call arguments.
response.output_item.doneAn output item is complete.
response.completedThe response ends, carrying the full output and usage.

The stream ends with a response.completed event.

curl https://api.crossmodel.ai/v1/responses \
  -H "Authorization: Bearer cm-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5-mini",
    "input": "Hi",
    "stream": true
  }'

Errors

Errors use one shared format:

{
  "error": {
    "message": "Responses field 'store' is not supported in this release.",
    "type": "invalid_request_error",
    "param": "store",
    "code": "unsupported_responses_feature"
  }
}
HTTP statustypeCommon codeNotes
400invalid_request_errorinvalid_json, invalid_responses_input, unsupported_responses_featureMalformed body JSON, input structure, or fields.
401authentication_errormissing_api_key, invalid_api_keyAPI key missing or invalid.
402billing_errorinsufficient_balanceAccount out of balance.
404invalid_request_errormodel_not_foundThe requested model doesn't exist or is currently unavailable.
429rate_limit_errorrate_limit_exceeded, provider_rate_limitedToo many requests — rate limited.
502provider_errorprovider_errorThe model service returned an error or an abnormal response.
503api_errormodel_unavailableModel temporarily unavailable — retry shortly.
500api_errorinternal_errorA CrossModel internal error.