Skip to main content

REST API

All public Messages API v3 endpoints are under:

https://msg.hidoba.com

Authentication

Send a quota API key with each generation request. Bearer auth is preferred.

curl https://msg.hidoba.com/v3/chat/completions \
-H "Authorization: Bearer YOUR_QUOTA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"google/gemini-2.5-flash","messages":[{"role":"user","content":"Say hello"}]}'

X-API-Key is also accepted:

X-API-Key: YOUR_QUOTA_API_KEY

Health

GET /health
GET /health/deep

Health endpoints are intended for uptime checks and deployment verification.

Chat Completions

POST /v3/chat/completions

Compatibility alias:

POST /v1/chat/completions

The request body follows the OpenAI Chat Completions shape. Messages API v3 also accepts a small number of Hidoba-specific additions.

FieldTypeRequiredDescription
modelStringYesRequested model name, for example google/gemini-2.5-flash.
messagesArrayYesOpenAI-compatible chat messages.
streamBooleanNoSet to true for streaming responses.
max_completion_tokensNumberNoPreferred output-token limit for compatible providers.
max_tokensNumberNoCompatibility output-token limit.
reasoningObjectNoOpenRouter-style reasoning control.
fallback_modelStringNoOptional fallback model for routing/content-policy retry. This is not sent provider-visible as fallback_model.
metadata.hidobaObjectNoHidoba character metadata. See Hidoba Metadata.

Example

curl https://msg.hidoba.com/v3/chat/completions \
-H "Authorization: Bearer $HIDOBA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-2.5-flash",
"messages": [
{ "role": "user", "content": "Reply with exactly: hello" }
],
"max_completion_tokens": 32
}'

The response is the provider/Bifrost OpenAI-compatible chat completion response.

Responses API

POST /v3/responses

Compatibility alias:

POST /v1/responses

The request body follows the OpenAI Responses API shape.

FieldTypeRequiredDescription
modelStringYesRequested model name.
inputString or ArrayYesResponses API input.
instructionsStringNoAdditional system instructions. Character and RAG prompts may be injected by Messages API v3 when configured.
streamBooleanNoSet to true for streaming responses when supported.
max_output_tokensNumberNoOutput-token limit for Responses API requests.
reasoningObjectNoOpenRouter-style reasoning control.
fallback_modelStringNoOptional fallback model.
metadata.hidobaObjectNoHidoba character metadata. See Hidoba Metadata.

Example

curl https://msg.hidoba.com/v3/responses \
-H "Authorization: Bearer $HIDOBA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-2.5-flash",
"input": "Write one concise sentence about Mars.",
"max_output_tokens": 80
}'

The response is the provider/Bifrost OpenAI-compatible Responses API response.

Reasoning

Use OpenRouter-style reasoning controls when the requested model/provider supports them.

Turn reasoning off:

{
"reasoning": { "effort": "none" }
}

Use an effort level:

{
"reasoning": { "effort": "low" }
}

Accepted effort values are none, low, medium, and high.

Use a token budget:

{
"reasoning": { "max_tokens": 1024 }
}

Reasoning support depends on the resolved provider and model.

Errors

Generation requests may fail before reaching the model if rc2 rejects the API key, quota, character, or metadata.

StatusMeaning
400Invalid request body, invalid metadata.hidoba, or character validation failure.
401Missing or invalid quota API key.
403Quota type or access is not allowed for this endpoint.
409Duplicate request id in rc2 lifecycle tracking.
429Quota is exhausted.
5xxProvider, Bifrost, or internal service failure.

Example error:

{
"detail": {
"code": "invalid_api_key",
"message": "Invalid API key",
"context": {
"request_id": "7ed3d6f1-1a9f-4f3b-90d3-7c681a9d9fb8",
"endpoint": "/v3/chat/completions"
}
}
}

Provider errors are proxied in the provider/Bifrost response shape.