π API Documentation
API Cup is an OpenAI-compatible API gateway. If your code already works with OpenAI, it works with API Cup β just change the base URL and API key.
Overview
API Cup gives you access to 80+ models from 10+ top AI providers through a single, unified endpoint. Text, vision, code, reasoning, TTS, image generation, and speech recognition β all OpenAI-compatible.
Supported Formats
| Format | Endpoint | Status |
|---|---|---|
| Chat Completions | /v1/chat/completions | β All text & vision models |
| Text-to-Speech | /v1/audio/speech | β 5 voices (Qwen CosyVoice) |
| Image Generation | /v1/images/generations | β 3 quality levels |
| Speech Recognition | /v1/audio/transcriptions | β Paraformer |
| List Models | /v1/models | β OpenAI-compatible |
Authentication
All API requests require an API key. Get yours from the Keys page after signing up.
Authorization: Bearer sk-your-api-key-here
Base URL
https://apicup.com
All endpoints are relative to this base URL. If you are using the OpenAI Python SDK:
from openai import OpenAI
client = OpenAI(
api_key="sk-your-key-here",
base_url="https://apicup.com/v1"
)
Quickstart
cURL
curl https://apicup.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-key-here" \
-d '{
"model": "deepseek-chat",
"messages": [
{"role": "user", "content": "Hello! What can you do?"}
]
}'
Python
from openai import OpenAI
client = OpenAI(
api_key="sk-your-key-here",
base_url="https://apicup.com/v1"
)
response = client.chat.completions.create(
model="deepseek-chat",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
JavaScript / Node.js
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "sk-your-key-here",
baseURL: "https://apicup.com/v1"
});
const response = await client.chat.completions.create({
model: "deepseek-chat",
messages: [{ role: "user", content: "Hello!" }]
});
console.log(response.choices[0].message.content);
Chat Completions
POST /v1/chat/completions
OpenAI-compatible chat completions. Supports streaming, system prompts, and multi-turn conversations.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | β | Model name (e.g. deepseek-chat) |
messages | array | β | Array of message objects |
stream | boolean | Enable SSE streaming (default: false) | |
temperature | float | 0 - 2. Controls randomness | |
max_tokens | integer | Max tokens in response |
Recommended Models
| Model | Best For | Input Price | Output Price |
|---|---|---|---|
deepseek-chat | General purpose | $0.34/M | $1.36/M |
deepseek-v4-pro | Complex reasoning | $1.10/M | $4.40/M |
qwen3.7-max | Chinese & multilingual | $2.40/M | $9.60/M |
kimi-k2.7-code | Code generation | $3.32/M | $13.28/M |
glm-5.2 | Chinese reasoning | $2.48/M | $14.88/M |
qwen3.5-flash | Cheapest option | $0.08/M | $0.80/M |
List Models
GET /v1/models
Returns all available models. OpenAI-compatible response format.
curl https://apicup.com/v1/models \
-H "Authorization: Bearer sk-your-key-here"
Text-to-Speech
POST /v1/audio/speech
OpenAI-compatible TTS. 5 Chinese voices powered by Qwen CosyVoice.
curl https://apicup.com/v1/audio/speech \
-H "Authorization: Bearer sk-your-key-here" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-tts-longchen",
"input": "δ½ ε₯½οΌζ¬’θΏδ½Ώη¨API Cupγ",
"voice": "longchen"
}' --output speech.mp3
Available Voices
| Voice ID | Model Name | Description |
|---|---|---|
longchen | qwen-tts-longchen | Male, general-purpose |
longwan | qwen-tts-longwan | Female, warm |
longjing | qwen-tts-longjing | Female, newscaster |
longhua | qwen-tts-longhua | Male, mature |
longyu | qwen-tts-longyu | Male, lively |
Image Generation
POST /v1/images/generations
OpenAI-compatible image generation. Powered by Qwen Wanx.
curl https://apicup.com/v1/images/generations \
-H "Authorization: Bearer sk-your-key-here" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-image-fast",
"prompt": "A cute orange cat sitting on a cloud, anime style",
"n": 1,
"size": "1024x1024"
}'
Quality Levels
| Model | Speed | Price |
|---|---|---|
qwen-image-fast | ~5s | $0.15 / image |
qwen-image-standard | ~15s | $0.15 / image |
qwen-image-hd | ~30s | $0.40 / image |
Speech Recognition
POST /v1/audio/transcriptions
OpenAI-compatible speech-to-text. Powered by Qwen Paraformer.
curl https://apicup.com/v1/audio/transcriptions \
-H "Authorization: Bearer sk-your-key-here" \
-F "file=@audio.mp3" \
-F "model=qwen-asr-paraformer"
Pricing
You pay per token. No monthly fees, no minimums. Top up with crypto (USDC, USDT, BTC, ETH, SOL) on the Payment page.
1 USD = 500,000 tokens. See the Pricing page for all model prices, or call /v1/models for pricing metadata.
Error Codes
| HTTP Code | Meaning |
|---|---|
200 | Success |
400 | Bad request β check your parameters |
401 | Invalid or missing API key |
402 | Insufficient balance β top up your account |
429 | Rate limited β slow down |
500 | Server error β contact support if persistent |
Contact
Questions? Issues? Feature requests?
π§ fordeman@proton.me