Completions
Create text completions from a prompt. Legacy API for non-chat models. OpenAI-compatible.
Create a text completion
Authorization
api_key API key authentication using Bearer token format
In: header
Request Body
application/json
Number of completions to generate and return the best
int64Echo the prompt in the response
Penalize repeated tokens (-2.0 to 2.0)
doubleToken bias map
Number of log probabilities to return
int64Maximum tokens to generate
int64Hadrian Extension: Request metadata for tracking and filtering
Model to use for completion
Hadrian Extension: List of models for multi-model routing (alternative to single model)
Number of completions to generate
int64Penalize new topics (-2.0 to 2.0)
doubleThe prompt to generate completions for
Hadrian Extension: Response format (OpenAI only supports this on chat/completions)
Random seed for reproducibility
int64Stop sequence(s)
Enable streaming
Stream options
Text to append after completion
Sampling temperature (0.0 to 2.0)
doubleNucleus sampling probability (0.0 to 1.0)
doubleUser identifier for abuse detection
Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/completions" \ -H "Content-Type: application/json" \ -d '{ "prompt": {} }'{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}