AIAI Gateway
AIAI Gateway/API Documentation
Get API Key

OpenAI Responses API

Use OpenAI Responses API for conversations. Responses API is the latest OpenAI API format with more flexible input.

Endpoint

POST https://your-domain.com/api/ai/v1/responses

Authentication

AuthorizationRequired
Bearer YOUR_API_KEY

Request

ParameterTypeRequiredDescription
modelstringRequiredModel name, e.g. gpt-4, gpt-4o-mini
inputstringRequiredInput text or conversation content
max_tokensintegerOptionalMaximum number of output tokens
temperaturefloatOptionalSampling temperature, controls randomness (0-2)
streambooleanOptionalEnable streaming response, set to true for SSE

Response

ParameterTypeDescription
idstringUnique response identifier
modelstringActual model used
outputstringGenerated text output
usageobjectToken usage statistics including prompt_tokens, completion_tokens, total_tokens

Examples

curl https://your-domain.com/api/ai/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-4",
    "input": "Hello, who are you?",
    "max_tokens": 1000
  }'