Chat Completion
Chat Completions
Endpoint: /api/chat/completions
/api/chat/completions
Description: Generates a chat completion response using the specified model. Requires sufficient user credits and valid model access permissions.
Authentication: Required (JWT token or Api Key)
HTTP Method: POST
Request Format:
Key Request Parameters:
Parameter
Type
Required
Description
model
string
Yes
ID of the model to use
messages
array
Yes
Array of message objects with role and content
temperature
number
No
Sampling temperature (0-2.0)
max_tokens
integer
No
Maximum tokens to generate
stream
boolean
No
Whether to stream the response
Response Format:
Response Codes:
200: Successfully generated completion
402: Insufficient credits
403: Model access forbidden
404: Model not found
Last updated