API ModelsAPI Models
Docs/Completions API
OpenAI

Completions API

GPT-5.4 Pro

Legacy text completions endpoint for GPT-5.4 Pro. Uses prompt-based input instead of messages.

Overview

GPT-5.4 Pro is only accessible via the Completions API (/v1/completions), not the Chat Completions API. It supports multi-turn model interactions and advanced API features. Use the prompt field (string or array) instead of messages.

Endpoint

POST/api/v1/completions

Available Models

Prices are per 1M tokens

ModelInputOutputDescription
gpt-5.4-pro¥180.00¥1440.00Deep reasoning, multi-turn, advanced API features

Request Parameters

modelrequiredstring
Model to use. Currently: gpt-5.4-pro
promptrequiredstring | string[]
The prompt(s) to complete. String or array of strings.
max_tokensinteger
Maximum tokens to generate. Default: 4096
streamboolean
Enable streaming responses. Default: false
temperaturenumber
Sampling temperature (0-2). Default: 1
top_pnumber
Nucleus sampling probability. Default: 1
ninteger
Number of completions to generate. Default: 1
stopstring | string[]
Stop sequences
presence_penaltynumber
Presence penalty (-2 to 2). Default: 0
frequency_penaltynumber
Frequency penalty (-2 to 2). Default: 0
suffixstring
Suffix appended after the completion
echoboolean
Echo prompt in addition to completion. Default: false

Basic Request

curl -X POST https://apimodels.app/api/v1/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.4-pro",
    "prompt": "Write a detailed analysis of quantum computing:",
    "max_tokens": 1024
  }'

Response

{
  "id": "cmpl-abc123",
  "object": "text_completion",
  "created": 1700000000,
  "model": "gpt-5.4-pro",
  "choices": [
    {
      "text": "Quantum computing leverages the principles of quantum mechanics...",
      "index": 0,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 256,
    "total_tokens": 268
  }
}

Streaming

Set stream: true to receive Server-Sent Events (SSE).

curl -X POST https://apimodels.app/api/v1/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.4-pro",
    "prompt": "Explain the theory of relativity:",
    "max_tokens": 1024,
    "stream": true
  }'

Billing

Credits are calculated based on actual token usage:

Cost = (prompt_tokens * input_price + completion_tokens * output_price) / 1,000,000
Credits = Cost(CNY) * 10  // ¥1 = 10 credits

Error Codes

400Invalid request parameters
401Invalid or missing API key
402Insufficient credits
404Model not found
429Rate limit exceeded
500Internal server error