Chat Completions
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-primemax_tokensinteger · min: 1 · nullableOptionalDeprecated
max_completion_tokensinteger · min: 1 · nullableOptional
temperaturenumber · max: 2 · nullableOptionalDefault:
1top_pnumber · max: 1 · nullableOptionalDefault:
1ninteger · min: 1 · max: 128 · nullableOptionalDefault:
1streamboolean · nullableOptionalDefault:
falsestopone of · nullableOptional
stringOptional
string[] · max: 4Optional
logprobsboolean · nullableOptionalDefault:
falsetop_logprobsinteger · max: 20 · nullableOptional
response_formatone of · nullableOptional
or
or
tool_choiceone of · nullableOptional
string · enumOptionalPossible values:
parallel_tool_callsbooleanOptionalDefault:
truefrequency_penaltynumber · min: -2 · max: 2 · nullableOptionalDefault:
0presence_penaltynumber · min: -2 · max: 2 · nullableOptionalDefault:
0seedinteger · 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
200
Chat completion response
application/json
idstringRequiredExample:
chatcmpl-abc123objectstring · enumRequiredPossible values:
createdintegerRequiredExample:
1677858242modelstringRequiredExample:
chat-primesystem_fingerprintstring · nullableOptional
service_tierstring · enum · nullableOptionalPossible values:
400
Bad Request - Invalid parameters
application/json
401
Unauthorized - Invalid or missing API key
application/json
404
Not Found - Model not found
application/json
422
Validation Error
application/json
429
Rate Limit Exceeded
application/json
500
Internal Server Error
application/json
503
Service Unavailable - Balance replenishment in progress. Retry the request after a short delay.
application/json
post
/chat/completionsLast updated
Was this helpful?