Skip to main content
POST
/
v1
/
chat
/
completions
curl https://ai-gateway.helicone.ai/v1/chat/completions \
  -H "Authorization: Bearer $HELICONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      { "role": "system", "content": "You are a helpful assistant." },
      { "role": "user", "content": "Say hello in one sentence." }
    ]
  }'
This request schema applies when using the Helicone AI Gateway with pass‑through billing (credits). In BYOK mode, the standard OpenAI Chat Completions schema is allowed. The schema is defined based on fields that are stable across all provider-model mappings. Learn more about pass‑through billing vs BYOK.
curl https://ai-gateway.helicone.ai/v1/chat/completions \
  -H "Authorization: Bearer $HELICONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      { "role": "system", "content": "You are a helpful assistant." },
      { "role": "user", "content": "Say hello in one sentence." }
    ]
  }'

Body

application/json
messages
object[]
required
Minimum length: 1
  • Option 1
  • Option 2
  • Option 3
  • Option 4
  • Option 5
  • Option 6
model
string
required
metadata
top_logprobs
integer | null
Required range: 0 <= x <= 20
temperature
top_p
user
string
safety_identifier
string
prompt_cache_key
string
cache_control
object
service_tier
Available options:
auto,
default,
flex,
scale,
priority
modalities
verbosity
Available options:
low,
medium,
high
reasoning_effort
Available options:
minimal,
low,
medium,
high
max_completion_tokens
integer | null
Required range: -9007199254740991 <= x <= 9007199254740991
frequency_penalty
number | null
default:0
Required range: -2 <= x <= 2
presence_penalty
number | null
default:0
Required range: -2 <= x <= 2
response_format
object
  • Option 1
  • Option 2
  • Option 3
store
boolean | null
default:false
stream
boolean | null
default:false
stop
logit_bias
object | null
logprobs
boolean | null
default:false
max_tokens
integer | null
Required range: -9007199254740991 <= x <= 9007199254740991
n
integer | null
default:1
Required range: 1 <= x <= 128
prediction
object | null
seed
integer | null
Required range: -9007199254740991 <= x <= 9007199254740991
stream_options
tools
object[]
  • Option 1
  • Option 2
tool_choice
Available options:
none,
auto,
required
parallel_tool_calls
boolean
default:true
function_call
Available options:
none,
auto
functions
object[]
Required array length: 1 - 128 elements

Response

200

Request accepted