Skip to main content
POST
/
v1
/
responses
curl --request POST \
  --url https://api.edgee.ai/v1/responses \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "openai/gpt-4o",
  "input": "What is the capital of France?"
}
'
{
  "id": "resp_abc123",
  "object": "response",
  "status": "completed",
  "created_at": 1677652288,
  "model": "openai/gpt-4o",
  "output": [
    {
      "id": "msg_1",
      "type": "message",
      "status": "completed",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "Paris"
        }
      ]
    }
  ],
  "usage": {
    "input_tokens": 8,
    "output_tokens": 1,
    "total_tokens": 9
  }
}

Documentation Index

Fetch the complete documentation index at: https://www.edgee.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

Creates a response using the OpenAI Responses API format (POST /v1/responses). This endpoint is compatible with OpenAI’s Responses API, making it easy to use with tools like the Codex CLI.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your API key. More info here

Headers

X-Edgee-Tags
string

Comma-separated list of tags for categorizing and filtering requests in analytics and logs. Example: production,agent,codex

X-Edgee-Debug
boolean

Enable debug mode to include additional debugging information in the response.

X-Edgee-Compression-Model
enum<string>

Compression bundle to apply.

Available options:
claude,
opencode,
cursor,
codex

Body

application/json
model
string
required

ID of the model to use, with provider prefix. Format: {author_id}/{model_id}.

Example:

"openai/gpt-4o"

input
required

The input to the model. Either a plain string (treated as a single user message) or a flat array of typed input items (messages, function calls, function call outputs).

instructions
string

System-level instruction prepended to the conversation. An alternative to including a system role message in the input array.

stream
boolean
default:false

If set, the response is streamed as Server-Sent Events (SSE).

max_output_tokens
integer

Maximum number of tokens to generate.

Required range: x >= 1
tools
object[]

Tools available to the model. Uses the Responses API flat format (no nested function key).

tool_choice

Controls tool selection.

Available options:
auto,
none
temperature
number

Sampling temperature between 0 and 2. Higher values produce more random outputs.

Required range: 0 <= x <= 2
top_p
number

Nucleus sampling probability. Alternative to temperature.

tags
string[]

List of string tags for categorizing and filtering requests in analytics and logs. Can also be sent via the X-Edgee-Tags header.

enable_debug
boolean

Enable debug mode to include additional information in the response.

edgee_tool_ids
string[]

List of Edgee-managed tool IDs to include automatically (e.g. edgee_current_time, edgee_generate_uuid). Each ID must be activated for your API key.

Example:
["edgee_current_time", "edgee_generate_uuid"]
edgee_pending_id
string

Pending operation ID when continuing a conversation after Edge Tool execution. The gateway injects stored Edge Tool results into the conversation history.

compression_model
enum<string>

Selects the compression bundle to apply to the request. Equivalent to the X-Edgee-Compression-Model header.

Available options:
claude,
opencode,
codex,
cursor

Response

Response created successfully

id
string
required

Unique identifier for the response, prefixed with resp_.

Example:

"resp_abc123"

object
enum<string>
required
Available options:
response
status
enum<string>
required

completed for non-streaming responses; in_progress is emitted on the initial response.created SSE event.

Available options:
completed,
in_progress
created_at
number
required

Unix timestamp (as a float) of when the response was created.

Example:

1677652288

model
string
required

The model used to generate the response.

Example:

"openai/gpt-4o"

output
object[]
required

Array of output items produced by the model.

usage
object
required

Token usage statistics for the response.