Skip to main content
POST
/
v1
/
chat
/
completions
cURL
curl https://api.deerapi.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DEERAPI_KEY" \
  -d '{
    "model": "gpt-5.4",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant."
      },
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }'
{
  "id": "<string>",
  "object": "<string>",
  "created": 123,
  "model": "<string>",
  "system_fingerprint": "<string>",
  "choices": [
    {
      "index": 123,
      "message": {
        "content": "<string>",
        "refusal": "<string>",
        "role": "<string>",
        "annotations": [
          {}
        ],
        "tool_calls": [
          {}
        ]
      },
      "finish_reason": "<string>"
    }
  ],
  "usage": {
    "completion_tokens": 123,
    "completion_tokens_details": {
      "reasoning_tokens": 123,
      "audio_tokens": 123,
      "accepted_prediction_tokens": 123,
      "rejected_prediction_tokens": 123
    },
    "prompt_tokens": 123,
    "prompt_tokens_details": {
      "cached_tokens": 123,
      "audio_tokens": 123
    },
    "total_tokens": 123
  },
  "service_tier": "<string>"
}

Overview

Use this endpoint to call the Chat workflow through DeerAPI. The API reference on this page shows the request schema, response schema, authentication requirements, and runnable examples for the configured endpoint.

Before you start

Use the DeerAPI base URL and pass your API Key in the Authorization header:
https://api.deerapi.com
Authorization: Bearer $DEERAPI_KEY

Model selection

Choose a current model ID from the live pricing page. Model availability changes over time, so avoid copying a model ID from an old project without checking the live list first.

Implementation notes

  • Use the OpenAPI playground for the exact request fields accepted by this endpoint.
  • Keep API Keys on the server side when you build production applications.
  • Log the request ID from failed calls so support can investigate the request.
  • Retry 429, 500, and 503 responses with exponential backoff.

Authorizations

Authorization
string
header
required

Use a DeerAPI API Key as a Bearer token.

Body

application/json

Use this field according to the endpoint schema.

model
string
default:gpt-5.4
required

Use this field according to the endpoint schema.

messages
object[]
required

Use this field according to the endpoint schema.

stream
boolean

Use this field according to the endpoint schema.

temperature
number

Use this field according to the endpoint schema.

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

Use this field according to the endpoint schema.

Required range: 0 <= x <= 1
max_completion_tokens
integer

Use this field according to the endpoint schema.

max_tokens
integer
deprecated

Use this field according to the endpoint schema.

presence_penalty
number

Use this field according to the endpoint schema.

frequency_penalty
number

Use this field according to the endpoint schema.

stop
any

Use this field according to the endpoint schema.

tools
object[]

Use this field according to the endpoint schema.

tool_choice
any

Use this field according to the endpoint schema.

response_format
object

Use this field according to the endpoint schema.

modalities
enum<string>[]

Use this field according to the endpoint schema.

Available options:
text,
audio
audio
object

Use this field according to the endpoint schema.

stream_options
object

Use this field according to the endpoint schema.

metadata
object

Use this field according to the endpoint schema.

reasoning_effort
enum<string>

Use this field according to the endpoint schema.

Available options:
none,
minimal,
low,
medium,
high,
xhigh
n
integer

Use this field according to the endpoint schema.

Required range: 1 <= x <= 128
logprobs
boolean

Use this field according to the endpoint schema.

top_logprobs
integer

Use this field according to the endpoint schema.

Required range: 0 <= x <= 20
logit_bias
object

Use this field according to the endpoint schema.

parallel_tool_calls
boolean

Use this field according to the endpoint schema.

prediction
object

Use this field according to the endpoint schema.

store
boolean

Use this field according to the endpoint schema.

safety_identifier
string

Use this field according to the endpoint schema.

service_tier
enum<string>

Use this field according to the endpoint schema.

Available options:
auto,
default,
flex,
priority
verbosity
enum<string>

Use this field according to the endpoint schema.

Available options:
low,
medium,
high
web_search_options
object

Use this field according to the endpoint schema.

prompt_cache_key
string

Use this field according to the endpoint schema.

prompt_cache_retention
enum<string>

Use this field according to the endpoint schema.

Available options:
in-memory,
24h
user
string
deprecated

Use this field according to the endpoint schema.

Response

200 - application/json

Successful Response

id
string
required

Use this field according to the endpoint schema.

object
string
required

Use this field according to the endpoint schema.

created
integer
required

Use this field according to the endpoint schema.

model
string
required

Use this field according to the endpoint schema.

system_fingerprint
string
required

Use this field according to the endpoint schema.

choices
object[]
required

Use this field according to the endpoint schema.

usage
object
required

Use this field according to the endpoint schema.

service_tier
string

Use this field according to the endpoint schema.