ai-chat
AI Chat — Unified LLM Gateway
Access 50+ language models through a single OpenAI-compatible endpoint via AceDataCloud.
Setup: See authentication for token setup.
Quick Start
curl -X POST https://api.acedata.cloud/v1/chat/completions \
-H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"model": "claude-sonnet-4-20250514", "messages": [{"role": "user", "content": "Hello!"}]}'
OpenAI SDK Drop-in
from openai import OpenAI
client = OpenAI(
api_key="your-token-here",
base_url="https://api.acedata.cloud/v1"
)
response = client.chat.completions.create(
model="gpt-4.1",
messages=[{"role": "user", "content": "Explain quantum computing"}]
)
print(response.choices[0].message.content)
Available Models
OpenAI GPT
| Model | Type | Best For |
|---|---|---|
gpt-4.1 |
Latest | General-purpose, high quality |
gpt-4.1-mini |
Small | Fast, cost-effective |
gpt-4.1-nano |
Tiny | Ultra-fast, lowest cost |
gpt-4o |
Multimodal | Vision + text |
gpt-4o-mini |
Small multimodal | Fast vision tasks |
o1 |
Reasoning | Complex reasoning tasks |
o1-mini |
Small reasoning | Quick reasoning |
o1-pro |
Pro reasoning | Advanced reasoning |
gpt-5 |
Latest gen | Next-gen intelligence |
gpt-5.4 |
Gen 5.4 | High-performance next-gen |
gpt-5-mini |
Mini gen 5 | Fast next-gen |
Anthropic Claude
| Model | Type | Best For |
|---|---|---|
claude-opus-4-6 |
Latest Opus | Highest capability |
claude-sonnet-4-6 |
Latest Sonnet | Balanced quality/speed |
claude-opus-4-5-20251101 |
Opus 4.5 | Premium tasks |
claude-sonnet-4-5-20250929 |
Sonnet 4.5 | High-quality balance |
claude-sonnet-4-20250514 |
Sonnet 4 | Reliable general-purpose |
claude-haiku-4-5-20251001 |
Haiku 4.5 | Fast, efficient |
claude-3-5-sonnet-20241022 |
Legacy 3.5 | Proven track record |
claude-3-opus-20240229 |
Legacy Opus | Maximum quality (legacy) |
Google Gemini
| Model | Best For |
|---|---|
gemini-1.5-pro |
Long context, complex tasks |
gemini-1.5-flash |
Fast, efficient |
DeepSeek
| Model | Best For |
|---|---|
deepseek-r1 |
Deep reasoning |
deepseek-r1-0528 |
Latest reasoning |
deepseek-v3 |
General-purpose |
deepseek-v3-250324 |
Latest general |
xAI Grok
| Model | Best For |
|---|---|
grok-4 |
Latest, highest capability |
grok-3 |
General-purpose |
grok-3-fast |
Speed-optimized |
grok-3-mini |
Compact, efficient |
Features
Streaming
POST /v1/chat/completions
{
"model": "claude-sonnet-4-20250514",
"messages": [{"role": "user", "content": "Write a story"}],
"stream": true
}
Function Calling
POST /v1/chat/completions
{
"model": "gpt-4.1",
"messages": [{"role": "user", "content": "What's the weather in Tokyo?"}],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"parameters": {"type": "object", "properties": {"location": {"type": "string"}}}
}
}
]
}
Vision
POST /v1/chat/completions
{
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "What's in this image?"},
{"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}
]
}
]
}
Parameters
| Parameter | Type | Description |
|---|---|---|
model |
string | Model name (see tables above) |
messages |
array | Array of {role, content} objects |
temperature |
0–2 | Randomness (default: 1) |
top_p |
0–1 | Nucleus sampling |
max_tokens |
integer | Maximum output tokens |
stream |
boolean | Enable SSE streaming |
tools |
array | Function calling definitions |
tool_choice |
string/object | Tool selection strategy |
Response
{
"id": "chatcmpl-xxx",
"object": "chat.completion",
"model": "claude-sonnet-4-20250514",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "Hello!"},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 5,
"total_tokens": 15
}
}
Gotchas
- 100% OpenAI-compatible — use the standard OpenAI SDK with
base_url="https://api.acedata.cloud/v1" - Billing is token-based with per-model pricing (more expensive models cost more per token)
- Vision is supported on multimodal models (
gpt-4o,gpt-4o-mini,grok-2-vision-*) - Function calling works on most modern models (GPT-4+, Claude 3+)
- Streaming returns
chat.completion.chunkobjects via SSE finish_reasonvalues:"stop"(complete),"length"(max tokens),"tool_calls"(function call),"content_filter"(filtered)
Stateful Conversations Endpoint
For stateful, session-based chat (no need to send the full history each time), use the /aichat/conversations endpoint:
curl -X POST https://api.acedata.cloud/aichat/conversations \
-H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-4.1", "question": "What is quantum computing?", "stateful": true}'
| Parameter | Type | Description |
|---|---|---|
model |
string | Model name (see Available Models above) |
question |
string | The prompt or question to answer |
id |
string | Conversation ID — pass the same ID to continue a session |
preset |
string | Preset/system prompt for the conversation |
stateful |
boolean | Enable stateful conversation (maintains history server-side) |
references |
array | Additional context documents to include |
More from acedatacloud/skills
luma-video
Generate AI videos with Luma Dream Machine via AceDataCloud API. Use when creating videos from text prompts, generating videos from reference images, extending existing videos, or any video generation task with Luma. Supports text-to-video, image-to-video, and video extension.
10short-url
Create short URLs via AceDataCloud API. Use when generating shortened links for sharing, or batch-creating multiple short URLs at once. Supports custom slugs and expiration.
9seedream-image
Generate and edit AI images with Seedream (ByteDance) via AceDataCloud API. Use when creating images from text prompts, editing existing images, or working with high-resolution outputs. Supports Seedream 3.0 T2I, 4.0, 4.5, 5.0, and SeedEdit 3.0 models.
9flux-image
Generate and edit images with Flux (Black Forest Labs) via AceDataCloud API. Use when creating images from text prompts, editing existing images with text instructions, or when high-quality image generation is needed. Supports multiple Flux models including dev, pro, ultra, and kontext for editing.
9veo-video
Generate AI videos with Google Veo via AceDataCloud API. Use when creating videos from text descriptions, animating still images into video, upscaling/extending videos, re-shooting with new camera motion, or inserting/removing objects. Supports Veo 2, Veo 3, and Veo 3.1 models including fast variants.
9sora-video
Generate AI videos with OpenAI Sora via AceDataCloud API. Use when creating videos from text prompts, generating videos from reference images, or using character references from existing videos. Supports text-to-video, image-to-video, and character-driven generation with multiple models and resolutions.
8