Create model response

Creates a model response using the same interface as the
OpenAI Create a model response
API. Provide a text input string to generate text or JSON outputs. Supports
non-streaming JSON and Server-Sent Events when stream=true.

Omit tools for a simple text response. Send optional tools for function calling (client vs server tools —
see overview above).

Request – Requires model and input. Additional parameters are provider-dependent — see
provider documentation for your model prefix (links in overview).

Tool calling and prompt/context caching are supported when the selected provider and model expose
those capabilities (check model info for supports_function_calling and supports_prompt_caching).

Tools – Client tools return function_call items in output for your application to execute.
Server tools registered on the gateway
run automatically without returning intermediate function_call items for those tools.

Streamingtext/event-stream with data: lines carrying typed events (response.created,
response.output_text.delta, response.completed, etc.). Stream ends with data: [DONE].

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Creates a model response using the same interface as the
OpenAI Create a model response
API. Provide a text input string to generate text or JSON outputs. Supports non-streaming JSON and Server-Sent Events when stream=true.

Request – Requires model and input. All other request fields (tools, stream, temperature, instructions, and others) are provider-dependent — availability and semantics vary by the upstream provider selected via the model prefix. Consult that provider's documentation:

model uses the provider/model identifier format (e.g. openai/gpt-4o-mini, anthropic/claude-sonnet-4-20250514, gemini/gemini-2.5-flash), consistent with other AI Gateway endpoints.

input – A string (shorthand for a user message).

Request body requires model and input (string). Additional parameters (tools, stream, temperature,
instructions, and others) are provider-dependent — their availability, value ranges, and semantics
vary by the upstream provider selected via the model prefix. Consult that provider's API documentation:

string
required

Model id in provider/model format (e.g. openai/gpt-4o-mini).

string
required

Text input (shorthand for a user message).

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
text/event-stream