Skip to main content
POST
/
responses
Create response
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    model: 'openai/gpt-5-nano',
    stream: false,
    input: [{role: 'user', content: 'Give me the current datetime in Asia/Tokyo.'}],
    tools: [{type: 'gateway:datetime', parameters: {timezone: 'Asia/Tokyo'}}],
    tool_choice: 'auto'
  })
};

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": [
        {
          "type": "output_text",
          "text": "<string>",
          "annotations": [
            {}
          ]
        }
      ],
      "call_id": "<string>",
      "name": "<string>",
      "arguments": "<string>"
    }
  ],
  "output_items": [
    {
      "type": "<string>",
      "role": "<string>",
      "content": [
        {
          "type": "output_text",
          "text": "<string>",
          "annotations": [
            {}
          ]
        }
      ],
      "call_id": "<string>",
      "name": "<string>",
      "arguments": "<string>"
    }
  ],
  "content": [
    {}
  ],
  "role": "<string>",
  "stop_reason": "<string>",
  "type": "<string>",
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123,
    "server_tool_use": {
      "datetime_requests": 1
    }
  }
}

Server tools

/v1/responses supports regular function tools and one gateway-managed server tool:
  • gateway:datetime
Web-search tool types are temporarily disabled at the gateway request layer.

Datetime example

curl https://api.phaseo.app/v1/responses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5-nano",
    "stream": false,
    "input": [
      { "role": "user", "content": "Give me the current datetime in Asia/Tokyo." }
    ],
    "tools": [
      {
        "type": "gateway:datetime",
        "parameters": { "timezone": "Asia/Tokyo" }
      }
    ],
    "tool_choice": "auto"
  }'
When a server tool is used, usage includes usage.server_tool_use.datetime_requests. Use stream: false when tools are present.

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

application/json
model
string
required
input
required
background
boolean
include
string[]
instructions
string
max_output_tokens
integer
Required range: x >= 1
metadata
object
parallel_tool_calls
boolean
previous_response_id
string
reasoning
object
service_tier
enum<string>
Available options:
auto,
default,
flex,
standard,
priority
store
boolean
stream
boolean
temperature
number
Required range: 0 <= x <= 2
text
object
tool_choice

Tool selection strategy. gateway:datetime is accepted and rewritten by the gateway into an upstream function/tool target.

Available options:
auto,
none,
required,
gateway:datetime
tools
object[]

Tool definitions for model function calls and gateway server tools. The only built-in gateway server tool is gateway:datetime. Web-search tool types (for example web_search_preview) are temporarily disabled by the gateway.

top_p
number
Required range: 0 <= x <= 1
truncation
enum<string>
Available options:
auto,
disabled
user
string
prompt_cache_key
string | null
safety_identifier
string | null
modalities
enum<string>[]
Available options:
text,
image,
audio
image_config
object
provider_options
object

Optional provider-specific options.

usage
boolean
meta
boolean
echo_upstream_request
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 April 1, 2026