Skip to content

Response Format

All IndoxHub API endpoints return a consistent JSON structure.

Common Response Fields

Field Type Description
request_id string Unique request identifier (UUID)
created_at string ISO 8601 timestamp
duration_ms float Request processing time in milliseconds
provider string Provider that handled the request
model string Model used
success boolean Whether the request succeeded
message string Status message (empty on success)
data varies Endpoint-specific response data
usage object Token and cost tracking

Usage Object

Field Type Description
tokens_prompt integer Input tokens consumed
tokens_completion integer Output tokens generated
tokens_total integer Total tokens
cost float Cost in USD
latency float Processing latency in ms
cache_read_tokens integer Tokens served from cache
cache_write_tokens integer Tokens written to cache
reasoning_tokens integer Internal reasoning tokens
web_search_count integer Web searches performed

Data Field by Endpoint

Endpoint data Type Description
Chat Completions string or dict Generated text response
Text Completions string Completed text
Embeddings list[list[float]] Embedding vectors
Image Generation list[dict] Image URLs or base64 data
Video Generation list[dict] Video data or job info
TTS dict Audio data/metadata
STT dict Transcription with metadata

Error Response

Failed requests return success: false with an error message:

{
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "success": false,
  "message": "Insufficient credits. Please top up your account.",
  "data": ""
}

Additional Fields

Some endpoints return extra fields:

  • Chat: finish_reason, reasoning_content, images
  • Embeddings: dimensions
  • Chat/Completions: raw_response (full provider response when available)
Documentation last built on May 23, 2026