Tài liệu

Responses Format

OpenAI Responses API for creating model responses. Supports multi-turn chat, tool calls, and reasoning.

FieldValue
Base URLhttps://token.easyapi.com/v1
AuthenticationAuthorization: Bearer `API_KEY`
Example modelgpt-4o
FormatOpenAI Responses compatible
BillingPay as you go
Note: Full path: POST /v1/responses. input may be a string or message array; use previous_response_id for multi-turn chats.

Example model

Examples below use gpt-4o (GPT-4o). Replace model and adjust size, quality, etc. per console docs when switching models.

Create response

POSThttps://token.easyapi.com/v1/responses

Create a model response with the OpenAI Responses API. Supports multi-turn chat, tool calls, and reasoning.

Request parameters

NameInTypeRequiredDescription
AuthorizationheaderstringYesEasyAPI API Key. Format: Bearer `API_KEY`
Content-TypeheaderstringYesRequest body format, always application/json

Request body

NameTypeRequiredDescription
modelstringYesModel ID
inputstring | array<object>NoInput content as a string or message array
instructionsstringNoSystem-level instructions for model behavior
max_output_tokensintegerNoMaximum output tokens
temperaturenumberNoSampling temperature
top_pnumberNoNucleus sampling parameter
streambooleanNoEnable streaming responses
toolsarray<object>NoTool definitions the model may call
tool_choicestring | objectNoTool choice strategy, string or object
reasoningobjectNoReasoning configuration
previous_response_idstringNoPrevious response ID for multi-turn chat
truncationstringNoTruncation strategy: auto

Example

{
  "model": "gpt-4o",
  "input": "Hello!",
  "instructions": "You are a helpful assistant.",
  "max_output_tokens": 1024
}

Response example

{
  "id": "resp_abc123",
  "object": "response",
  "created_at": 1718452800,
  "status": "completed",
  "model": "gpt-4o",
  "output": [
    {
      "type": "message",
      "id": "msg_abc123",
      "status": "completed",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "Hello! How can I help you today?"
        }
      ]
    }
  ],
  "usage": {
    "prompt_tokens": 15,
    "completion_tokens": 12,
    "total_tokens": 27,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "text_tokens": 15,
      "audio_tokens": 0,
      "image_tokens": 0
    },
    "completion_tokens_details": {
      "text_tokens": 12,
      "audio_tokens": 0,
      "reasoning_tokens": 0
    }
  }
}