Chat Completions

Create chat completions using various LLM models. Compatible with the OpenAI chat completions API format.

Create chat completion

post

Creates a chat completion for the provided messages using the specified model. This endpoint is compatible with the OpenAI chat completions API format.

The request is validated and then routed to the appropriate LLM provider. Your account balance is checked before processing.

Authorizations
AuthorizationstringRequired

Bearer token authentication using your API key.

Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Generate API keys from your Grid Dashboard.

Body
modelstringOptionalExample: chat-prime
max_tokensinteger · min: 1 · nullableOptionalDeprecated
max_completion_tokensinteger · min: 1 · nullableOptional
temperaturenumber · max: 2 · nullableOptionalDefault: 1
top_pnumber · max: 1 · nullableOptionalDefault: 1
ninteger · min: 1 · max: 128 · nullableOptionalDefault: 1
streamboolean · nullableOptionalDefault: false
stopone of · nullableOptional
stringOptional
or
string[] · max: 4Optional
logprobsboolean · nullableOptionalDefault: false
top_logprobsinteger · max: 20 · nullableOptional
response_formatone of · nullableOptional
or
or
tool_choiceone of · nullableOptional
string · enumOptionalPossible values:
or
parallel_tool_callsbooleanOptionalDefault: true
frequency_penaltynumber · min: -2 · max: 2 · nullableOptionalDefault: 0
presence_penaltynumber · min: -2 · max: 2 · nullableOptionalDefault: 0
seedinteger · nullableOptional
service_tierstring · enum · nullableOptionalPossible values:
reasoning_effortstring · enum · nullableOptionalPossible values:
storeboolean · nullableOptional
verbositystring · enum · nullableOptionalPossible values:
prompt_cache_keystring · nullableOptional
prompt_cache_retentionstring · enum · nullableOptionalPossible values:
safety_identifierstring · nullableOptional
routestring · enumOptionalPossible values:
providerobjectOptional
userstringOptionalDeprecated
Responses
chevron-right
200

Chat completion response

application/json
idstringRequiredExample: chatcmpl-abc123
objectstring · enumRequiredPossible values:
createdintegerRequiredExample: 1677858242
modelstringRequiredExample: chat-prime
system_fingerprintstring · nullableOptional
service_tierstring · enum · nullableOptionalPossible values:
post
/chat/completions

Last updated

Was this helpful?