OpenAI Responses
POST
/v1/responsesUse an OpenAI Responses-compatible endpoint for text, tools, and multimodal requests.
The gateway either forwards or translates the request according to the selected model route. Use only fields supported by that model and route.
Core request fields
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | A model ID returned by /v1/models. |
input | string | array | Yes | Text or a list of Responses input items. |
instructions | string | No | High-level instructions for this response. |
stream | boolean | No | Returns Responses-style SSE events when true. |
tools | array | No | Tools available to the model. |
max_output_tokens | integer | No | Requested maximum output token count. |
Request examples
curl
curl https://api.noxgate.net/v1/responses \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_MODEL_ID","input":"Hello","stream":false}'Python · OpenAI SDK
from openai import OpenAI
client = OpenAI(api_key="sk-your-api-key", base_url="https://api.noxgate.net/v1")
response = client.responses.create(model="YOUR_MODEL_ID", input="Hello")
print(response.output_text)Node.js · OpenAI SDK
import OpenAI from "openai";
const client = new OpenAI({ apiKey: "sk-your-api-key", baseURL: "https://api.noxgate.net/v1" });
const response = await client.responses.create({ model: "YOUR_MODEL_ID", input: "Hello" });
console.log(response.output_text);Streaming
With stream=true, the endpoint returns Responses-style SSE events. Process event/data increments and wait for a completion event. Errors after the stream starts may also arrive as events.
curl · SSE
curl https://api.noxgate.net/v1/responses \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_MODEL_ID","input":"Hello","stream":true}'Context compaction
POST /v1/responses/compact uses the same authentication and model routing for Providers that support context compaction. Availability depends on the selected model route.
curl
curl https://api.noxgate.net/v1/responses/compact \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{"model":"YOUR_MODEL_ID","input":"Hello","stream":false}'Successful response
JSON
{"id":"resp_example","object":"response","model":"YOUR_MODEL_ID","status":"completed","output":[],"usage":{"input_tokens":8,"output_tokens":3,"total_tokens":11}}