Skip to main content
POST
/
responses
Create response
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    model: '<string>',
    input: '<string>',
    input_items: [{type: '<string>', role: 'user', content: '<string>', phase: 'commentary'}],
    conversation: '<string>',
    include: ['<string>'],
    instructions: '<string>',
    max_output_tokens: 2,
    max_completion_tokens: 2,
    max_tokens: 2,
    max_tool_calls: 1,
    metadata: {},
    parallel_tool_calls: true,
    previous_response_id: '<string>',
    prompt: {id: '<string>', variables: {}, version: '<string>'},
    prompt_cache_key: '<string>',
    prompt_cache_retention: '<string>',
    provider_options: {openai: {context_management: {type: 'compaction', compact_threshold: 123}}},
    providerOptions: {openai: {contextManagement: {type: 'compaction', compactThreshold: 123}}},
    reasoning: {effort: 'none', summary: '<string>', enabled: true, max_tokens: 1},
    thinking: {
      type: 'enabled',
      enabled: true,
      include_thoughts: true,
      includeThoughts: true,
      effort: 'none',
      max_tokens: 1,
      maxTokens: 1,
      budget_tokens: 1,
      budgetTokens: 1
    },
    modalities: ['<string>'],
    response_modalities: ['<string>'],
    responseModalities: ['<string>'],
    image_config: {
      aspect_ratio: '<string>',
      aspectRatio: '<string>',
      image_size: '0.5K',
      imageSize: '0.5K',
      include_rai_reason: true,
      includeRaiReason: true,
      font_inputs: [{font_url: '<string>', text: '<string>'}],
      fontInputs: [{fontUrl: '<string>', text: '<string>'}],
      super_resolution_references: ['<string>'],
      superResolutionReferences: ['<string>'],
      reference_images: [{}],
      referenceImages: [{}]
    },
    imageConfig: {
      aspect_ratio: '<string>',
      aspectRatio: '<string>',
      image_size: '0.5K',
      imageSize: '0.5K',
      include_rai_reason: true,
      includeRaiReason: true,
      font_inputs: [{font_url: '<string>', text: '<string>'}],
      fontInputs: [{fontUrl: '<string>', text: '<string>'}],
      super_resolution_references: ['<string>'],
      superResolutionReferences: ['<string>'],
      reference_images: [{}],
      referenceImages: [{}]
    },
    safety_identifier: '<string>',
    service_tier: '<string>',
    speed: '<string>',
    store: true,
    stream: true,
    stream_options: {},
    temperature: 1,
    text: {},
    tool_choice: '<string>',
    tools: [{}],
    top_logprobs: 10,
    top_p: 0.5,
    truncation: '<string>',
    background: true,
    user: '<string>',
    usage: true,
    meta: true,
    debug: {
      enabled: true,
      return_upstream_request: true,
      return_upstream_response: true,
      trace: true,
      trace_level: 'summary'
    },
    provider: {
      order: ['<string>'],
      only: ['<string>'],
      ignore: ['<string>'],
      include_alpha: true
    }
  })
};

fetch('https://api.phaseo.app/v1/responses', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "id": "<string>",
  "object": "<string>",
  "created": 123,
  "model": "<string>",
  "output": [
    {
      "type": "<string>",
      "role": "<string>",
      "content": [
        {}
      ],
      "phase": "final_answer"
    }
  ],
  "output_items": [
    {
      "type": "<string>",
      "role": "<string>",
      "content": [
        {}
      ],
      "phase": "final_answer"
    }
  ],
  "content": [
    {}
  ],
  "role": "<string>",
  "stop_reason": "<string>",
  "type": "<string>",
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  }
}
For assistant messages on the Responses API, you can use phase with:
  • commentary for intermediate assistant messages
  • final_answer for final assistant messages
When sending follow-up turns with prior assistant messages, preserve and resend their original phase values.

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

application/json
model
string
required
input
input_items
object[]
conversation
include
string[]
instructions
string
max_output_tokens
integer
Required range: x >= 1
max_completion_tokens
integer
Required range: x >= 1
max_tokens
integer
Required range: x >= 1
max_tool_calls
integer
Required range: x >= 0
metadata
object
parallel_tool_calls
boolean
previous_response_id
string
prompt
object
prompt_cache_key
string
prompt_cache_retention
string
provider_options
object

Optional provider-specific options. Currently only OpenAI context_management is supported on /v1/responses.

providerOptions
object

Camel-case alias of provider_options.

reasoning
object
thinking
object
modalities
string[]
response_modalities
string[]
responseModalities
string[]
image_config
object
imageConfig
object
safety_identifier
string
service_tier
string
speed
string
store
boolean
stream
boolean
stream_options
object
temperature
number
Required range: 0 <= x <= 2
text
object
tool_choice
tools
object[]
top_logprobs
integer
Required range: 0 <= x <= 20
top_p
number
Required range: 0 <= x <= 1
truncation
string
background
boolean
user
string
usage
boolean
meta
boolean
debug
object

Gateway debug controls. These flags are never forwarded upstream.

provider
object

Provider routing preferences for gateway selection.

Response

200 - application/json

Response

id
string
object
string
created
integer
model
string
output
object[]
output_items
object[]
content
object[]
role
string
stop_reason
string
type
string
usage
object
Last modified on March 2, 2026