πŸ“– 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

FormatEndpointStatus
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
πŸ” Security: Never expose your API key in client-side code. Use environment variables or a backend proxy.

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

ParameterTypeRequiredDescription
modelstringβœ…Model name (e.g. deepseek-chat)
messagesarrayβœ…Array of message objects
streambooleanEnable SSE streaming (default: false)
temperaturefloat0 - 2. Controls randomness
max_tokensintegerMax tokens in response

Recommended Models

ModelBest ForInput PriceOutput Price
deepseek-chatGeneral purpose$0.34/M$1.36/M
deepseek-v4-proComplex reasoning$1.10/M$4.40/M
qwen3.7-maxChinese & multilingual$2.40/M$9.60/M
kimi-k2.7-codeCode generation$3.32/M$13.28/M
glm-5.2Chinese reasoning$2.48/M$14.88/M
qwen3.5-flashCheapest 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 IDModel NameDescription
longchenqwen-tts-longchenMale, general-purpose
longwanqwen-tts-longwanFemale, warm
longjingqwen-tts-longjingFemale, newscaster
longhuaqwen-tts-longhuaMale, mature
longyuqwen-tts-longyuMale, 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

ModelSpeedPrice
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 CodeMeaning
200Success
400Bad request β€” check your parameters
401Invalid or missing API key
402Insufficient balance β€” top up your account
429Rate limited β€” slow down
500Server error β€” contact support if persistent

Contact

Questions? Issues? Feature requests?

πŸ“§ fordeman@proton.me