Skip to main content
POST
/
v1
/
responses
curl --request POST \
  --url https://api.vivgrid.com/v1/responses \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gpt-5.2-codex",
  "input": "Create a amazon-like web app."
}
'
{
  "id": "<string>",
  "object": "<string>",
  "model": "<string>",
  "created_at": 123,
  "status": "<string>",
  "output": [
    {}
  ],
  "usage": {},
  "service_tier": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
string

gpt-5.1-codex, gpt-5.1-codex-max or gpt-5.2-codex.

input

Text, image, file, or chat-style inputs. The Responses API accepts a string or an array of input items/messages.

instructions
string

A system (or developer) message inserted into the model's context.

background
boolean
default:false

Whether to run the model response in the background.

store
boolean
default:true

Whether to store the generated model response for later retrieval via API.

previous_response_id
string

The unique ID of the previous response to the model. Cannot be used with 'conversation'.

conversation

Conversation that this response belongs to. Items are prepended to the request. Cannot be used with 'previous_response_id'.

include
string[]

Additional output data to include in the response.

max_output_tokens
integer

Upper bound for generated tokens (includes visible output tokens and reasoning tokens).

Required range: x >= 1
max_tool_calls
integer

Maximum total built-in tool calls processed in a response.

Required range: x >= 0
parallel_tool_calls
boolean
default:true

Whether to allow tool calls in parallel.

tools
object[]

Tools the model may call (built-in tools, MCP tools, or developer-defined function tools).

tool_choice

How the model should select which tool(s) to use.

text
object

Configuration options for a text response from the model (plain text or structured JSON).

reasoning
object

Reasoning configuration (gpt-5 and o-series models).

temperature
number
default:1
Required range: 0 <= x <= 2
top_p
number
default:1
Required range: 0 <= x <= 1
top_logprobs
integer

Number of most likely tokens to return per position with logprobs.

Required range: 0 <= x <= 20
truncation
enum<string>
default:disabled

Truncation strategy when input exceeds the model context window.

Available options:
auto,
disabled
stream
boolean
default:false

If true, stream the response via server-sent events.

stream_options
object

Options for streaming responses (only when stream=true).

metadata
object

Up to 16 key/value pairs for storing structured metadata.

prompt
object

Reference to a prompt template and its variables.

prompt_cache_key
string

Cache key used to help optimize prompt caching.

prompt_cache_retention
string

Retention policy for prompt cache (e.g. '24h').

safety_identifier
string

Stable identifier for abuse detection (recommended to hash username/email).

service_tier
string
default:auto

Processing tier (e.g., auto/default/flex/priority).

user_id
string

Hashed user indentify for improved monitoring and abuse detection.

Response

OK (non-streaming): a Response object

A model response object returned by the Responses API.

id
string
required
object
string
required
model
string
required
created_at
integer

Unix timestamp (seconds).

status
string
output
object[]

Output items produced by the model (messages, tool calls, reasoning items, etc.).

usage
object

Token usage and related accounting fields.

service_tier
string

Service tier actually used to process the request (may differ from requested).