Skip to main content
POST
/
v1
/
responses
Openai Compatible Responses Api
curl --request POST \
  --url https://api.compilelabs.com/v1/responses \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "input": "<string>",
  "instructions": "You are a helpful AI assistant.",
  "max_output_tokens": 1024,
  "temperature": 0.7,
  "top_p": 0.9,
  "tools": [
    {
      "name": "<string>",
      "parameters": {
        "type": "object",
        "required": "location",
        "properties": {
          "location": {
            "description": "The city and state, e.g. San Francisco, CA",
            "type": "string"
          },
          "unit": {
            "description": "Unit for the output - one of (celsius, fahrenheit)",
            "type": "string"
          }
        }
      },
      "type": "function",
      "description": "Get the current weather in a given location"
    }
  ],
  "tool_choice": "auto",
  "parallel_tool_calls": true,
  "stream": false,
  "text": {
    "type": "text"
  },
  "reasoning": {
    "effort": "medium",
    "summary": "auto"
  }
}
'
{
  "id": "<string>",
  "created_at": 123,
  "model": "<string>",
  "status": "in_progress",
  "output": [
    {
      "id": "<string>",
      "summary": [
        {
          "text": "<string>",
          "type": "summary_text"
        }
      ],
      "type": "reasoning",
      "status": "in_progress",
      "content": [
        {
          "text": "<string>",
          "type": "reasoning_text"
        }
      ],
      "encrypted_content": "<string>"
    }
  ],
  "object": "response",
  "conversation": {
    "id": "<string>"
  },
  "usage": {
    "input_tokens": 123,
    "output_tokens": 123,
    "total_tokens": 123,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens_details": {
      "reasoning_tokens": 50
    }
  },
  "error": {},
  "incomplete_details": {},
  "instructions": "<string>",
  "max_output_tokens": 123,
  "parallel_tool_calls": true,
  "reasoning": {
    "effort": "medium",
    "summary": "auto"
  },
  "temperature": 1,
  "text": {
    "type": "text"
  },
  "tool_choice": "auto",
  "tools": [
    {
      "name": "<string>",
      "parameters": {
        "type": "object",
        "required": "location",
        "properties": {
          "location": {
            "description": "The city and state, e.g. San Francisco, CA",
            "type": "string"
          },
          "unit": {
            "description": "Unit for the output - one of (celsius, fahrenheit)",
            "type": "string"
          }
        }
      },
      "type": "function",
      "description": "Get the current weather in a given location"
    }
  ],
  "top_p": 1
}

Headers

x-api-key
string | null

Your API key.

Body

application/json

Request model for creating a response.

model
string
required

Model ID to use for the response.

Required string length: 1 - 255
input
required

The input to the model. Can be a simple string or an array of input items including reasoning from previous turns.

instructions
string | null

System instructions for the model.

Maximum string length: 32000
Example:

"You are a helpful AI assistant."

max_output_tokens
integer | null

Maximum number of tokens to generate.

Required range: x > 0
Example:

1024

temperature
number | null
default:1

Sampling temperature between 0 and 2.

Required range: 0 <= x <= 2
Example:

0.7

top_p
number | null
default:1

Nucleus sampling parameter.

Required range: 0 <= x <= 1
Example:

0.9

tools
ResponsesFunction · object[] | null

List of tools the model may call.

tool_choice
default:auto

Controls which tool is called by the model.

Available options:
auto,
none,
required
parallel_tool_calls
boolean
default:true

Whether to enable parallel function calling.

stream
boolean | null
default:false

Whether to stream the response using server-sent events.

text
Text · object

Text output format configuration.

  • Text
  • JSONSchema
reasoning
Reasoning · object

Configuration options for reasoning models.

Response

Successful Response

Response object from the Responses API.

id
string
required

Unique identifier for the response.

created_at
integer
required

Unix timestamp (in seconds) of when this Response was created.

model
string
required

Model ID used to generate the response, like moonshotai/kimi-k2 or anthropic/claude-sonnet-4-5. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model library to browse and compare available models.

status
enum<string>
required

The status of the response.

Available options:
in_progress,
completed,
failed,
cancelled,
incomplete
output
(ReasoningItem · object | OutputMessageItem · object | FunctionCallOutputItem · object)[]
required

An array of content items generated by the model. The length and order of items in the output array is dependent on the model's response. Rather than accessing the first item in the output array and assuming it's an assistant message with the content generated by the model, you might consider using the output_text property where supported in SDKs.

Reasoning output item containing the model's thinking process.

  • ReasoningItem
  • OutputMessageItem
  • FunctionCallOutputItem
object
string
default:response

The object type of this resource - always set to 'response'.

Allowed value: "response"
conversation
ResponseConversation · object

The conversation that this response belongs to. Input items and output items from this response are automatically added to this conversation.

usage
ResponseUsage · object

Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.

error
Error · object

An error object returned when the model fails to generate a Response.

incomplete_details
Incomplete Details · object

Details if the response is incomplete.

instructions
string | null

The instructions provided for this response.

max_output_tokens
integer | null

Maximum output tokens configured.

parallel_tool_calls
boolean
default:true

Whether parallel tool calls are enabled.

reasoning
Reasoning · object

Configuration options for reasoning models.

temperature
number
default:1

The temperature used for generation.

text
Text · object

Text format configuration.

  • Text
  • JSONSchema
tool_choice
default:auto

The tool choice configuration.

Available options:
auto,
none,
required
tools
ResponsesFunction · object[]

The tools available to the model.

top_p
number
default:1

The top_p value used for generation.