Client Methods¶
Reference for all IndoxHub API client methods.
Chat Completions¶
POST /api/v1/chat/completions¶
Generate a chat completion from a conversation.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
messages |
list[ChatMessage] |
Yes | Conversation messages |
model |
string |
No | Model ID |
temperature |
float |
No | Sampling temperature |
max_tokens |
int |
No | Max response tokens |
top_p |
float |
No | Nucleus sampling |
frequency_penalty |
float |
No | Frequency penalty |
presence_penalty |
float |
No | Presence penalty |
stream |
bool |
No | Enable SSE streaming |
additional_params |
dict |
No | Provider-specific params |
byok_api_key |
string |
No | Your own provider key |
Returns: ChatResponse
Text Completions¶
POST /api/v1/completions¶
Generate a text completion from a prompt.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
prompt |
string |
Yes | Text prompt |
model |
string |
No | Model ID |
stream |
bool |
No | Enable streaming |
| (same optional params as chat) |
Returns: CompletionResponse
POST /api/v1/completions/stop-stream/{stream_id}¶
Cancel an active completion stream.
Returns: {"success": bool}
Embeddings¶
POST /api/v1/embeddings¶
Generate vector embeddings for text.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
text |
string or list |
Yes | Input text(s) |
model |
string |
No | Embedding model |
Returns: EmbeddingResponse with data: list[list[float]] and dimensions: int
Image Generation¶
POST /api/v1/images/generations¶
Generate images from a text prompt.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
prompt |
string |
Yes | Image description |
model |
string |
No | Model ID |
size |
string |
No | Dimensions (1024x1024) |
n |
int |
No | Number of images |
Returns: ImageResponse with data: list[dict]
Video Generation¶
POST /api/v1/videos/generations¶
Generate video from a text prompt (async).
Returns: VideoResponse
GET /api/v1/videos/jobs/{job_id}¶
Get video generation job status.
GET /api/v1/videos/jobs¶
List video generation jobs. Query params: limit, skip.
POST /api/v1/videos/jobs/{job_id}/cancel¶
Cancel a pending video generation job.
Audio — Text-to-Speech¶
POST /api/v1/audio/tts/generations¶
Convert text to speech audio.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
input |
string |
Yes | Text to speak |
voice |
string |
No | Voice selection |
speed |
float |
No | Speed (0.25–4.0) |
Returns: AudioResponse
Audio — Speech-to-Text¶
POST /api/v1/audio/stt/transcriptions¶
Transcribe audio to text. Uses multipart/form-data.
POST /api/v1/audio/stt/translations¶
Translate audio to English. Uses multipart/form-data.
Models¶
GET /api/v1/models/¶
List all providers and models (no auth required).
GET /api/v1/models/trending¶
Get trending models. Query params: days, limit.
GET /api/v1/models/{provider_id}/{model_id}¶
Get detailed model information (no auth required).