IndexCube Inference API
Discover available models and run text inference from your application using the IndexCube API.
https://api.indexcube.com/v1Authentication
In the Portal, open API keys and create a key. Save it when it’s shown. Send it in the Authorization header as a bearer token.
Authorization: Bearer YOUR_INDEXCUBE_API_KEYStore your key in a server-side environment variable or secret manager. Keep it out of browser code and source control. Revoke exposed keys in the Portal.
Quickstart
Set INDEXCUBE_API_KEY in your environment, then list the available models. Copy an id from the response and use it in a chat completion.
curl https://api.indexcube.com/v1/models \
-H "Authorization: Bearer $INDEXCUBE_API_KEY"Chat completions require enough prepaid credit to cover the request reservation. Review your balance in the Portal before sending requests.
/v1/modelsList models
Returns the models currently enabled for inference. Use the model’s id as the model value in a chat request. An empty data array means there are no active models on enabled clusters.
{
"object": "list",
"data": [
{
"id": "example-model",
"object": "model",
"created": 1700000000,
"owned_by": "indexcube"
}
]
}/v1/chat/completionsChat completions
Send a JSON request with an available model ID and a list of text messages. Read the generated response from choices[0].message.content in a standard chat completion response. Usage is returned in usage.
curl https://api.indexcube.com/v1/chat/completions \
-H "Authorization: Bearer $INDEXCUBE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "example-model",
"messages": [{"role": "user", "content": "Hello from IndexCube."}],
"max_tokens": 128,
"stream": false
}'- model Required
- An ID returned by the models endpoint.
- messages Required
- 1–40 messages with string content. Roles are system, developer, user, and assistant.
- max_tokens
- Output limit from 1 to 2,048. Defaults to 512.
- temperature
- Optional numeric sampling value in the range 0–2.
- stream
- Omit or set to false. Streaming is unavailable in v1.
/healthHealth check
Use https://api.indexcube.com/health without authentication to check whether the HTTP gateway responds. This endpoint doesn’t test upstream inference availability.
{"status":"ok"}Errors and limits
API errors include error.message and error.type. Each key is limited to 60 authenticated requests per minute. Chat request bodies are limited to 64 KiB.
- 400
- Check the JSON body and required fields.
- 401
- Check that the bearer key is valid and active.
- 402
- Check the prepaid balance available for the request.
- 404
- Check the endpoint or refresh the model list.
- 413
- Reduce the size of the request body.
- 429
- Wait for the interval indicated by the Retry-After header.
- 5xx
- Check service status and review the error before retrying a completion.
Need help? Open a support ticket in the Portal.