Chat Completion
Authentication: Required (JWT token or Api Key)
Generates a chat completion response using the specified model. Requires sufficient user credits and valid model.
Enter your API key or JWT with the 'Bearer ' prefix
ID of the model to use for completion
Whether to stream back partial progress
falseWhat sampling temperature to use, between 0 and 2
1An alternative to sampling with temperature, called nucleus sampling
1The maximum number of tokens to generate in the completion
Seed for deterministic results
Maximum number of completion tokens
Number between -2.0 and 2.0 to penalize repeated tokens
0Number between -2.0 and 2.0 to penalize tokens already present in the text
0Successfully generated completion
Insufficient credits
Model access forbidden
Model not found
curl -X POST "https://app.morphware.com/api/chat/completions" \
-H "Authorization: Bearer <YOUR_TOKEN>" \
-d '{
"model": "llama3.3:70b-instruct-q8_0",
"messages": [
{"role": "user", "content": "Hello, can you help me with a coding problem?"}
]
}'
{
"usage": {
"prompt_tokens": 24,
"completion_tokens": 42,
"total_tokens": 66
},
"choices": {
"id": "chat-12345abcde",
"created": 1707841963,
"model": "llama3.3:70b-instruct-q8_0",
"choices": [
{
"index": 0,
"logprobs": null,
"finish_reason": "stop",
"message": {
"content": "I'd be happy to help with your coding problem. Could you please describe the issue you're facing in more detail? What programming language are you working with, and what specific problem are you trying to solve?",
"role": "assistant"
}
}
],
"object": "chat.completion"
}
}Last updated