Quickstart
Make your first API call in under 2 minutes
Prerequisites
- An OpenModel account — sign up at Swape.AI
- An API key — create one in the Console under API Keys
Set Your Base URL
All Swape.AI API requests go through:
https://wwape.aiMake Your First Request
Choose your preferred API format:
OpenAI Format (Responses API)
curl https://swape.ai/v1/responses \
-H "Authorization: Bearer $SWAPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"input": "Hello, who are you?"
}'Anthropic Format (Messages API)
curl https://swape.ai/v1/messages \
-H "x-api-key: $SWAPE_API_KEY" \
-H "content-type: application/json" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-sonnet-4-20250514",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Hello, who are you?"}
]
}'Gemini Format
curl "https://swape.ai/v1beta/models/gemini-2.0-flash:generateContent?key=$SWAPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{"parts": [{"text": "Hello, who are you?"}]}
]
}'DeepSeek Format (Messages API)
DeepSeek, DashScope, and Xiaomi models are all accessible through the Messages API using the Anthropic SDK — just change the model name.
curl https://swape.ai/v1/messages \
-H "x-api-key: $SWAPE_API_KEY" \
-H "content-type: application/json" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "deepseek-chat",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Hello, who are you?"}
]
}'Tip: The code above is identical to the Anthropic Format example — only the
modelname changes. Replacedeepseek-chatwith any supported model:qwen3-max,mimo-v2.5-pro, etc. See Available Models for the full list.
Next Steps
- Authentication — Learn about all authentication methods
- Streaming — Enable real-time streaming responses
- Available Models — Browse all supported providers and models
- API Reference — Full API documentation