chat
Generate or explain code
Generate, complete or explain code with top coding models. Accepts either a prompt string or an OpenAI-style messages array. Also available at /code/chat/completions.
post/code/completions
Request
- Base URLhttps://api.krater.ai/v1
- AuthHTTP bearer
Request body
Example request
{
"model": "anthropic/claude-sonnet-4",
"language": "python"
}Response
Code completion in an OpenAI chat-completion shape.
Example response
{
"id": "chatcmpl-abc123",
"choices": [
{
"finish_reason": "stop"
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.