Skip to content

5-Minute Quick Access - Quick Start Tutorial

A detailed tutorial teaching you how to quickly use ExchangeToken to call ChatGPT, Claude, and Gemini APIs.

⭐ What is ExchangeToken

The ExchangeToken platform provides developers with a unified OpenAI-compatible interface to access models from multiple providers, avoiding the need to integrate different APIs for each platform.

Step 1: Get API Key in 1 Minute

🔑 Two Ways to Get a Key

  1. Go to the Token Management Page
  2. Find the Default Token
  3. Click the Copy button on the right

Pros: Ready to use immediately, no configuration needed

⚠️ Security Warning

  • Please keep your key secure
  • Do not commit to public GitHub repositories
  • Recommended to use environment variables for storage

Step 2: First Call in 30 Seconds

🎯 Simplest Testing Method

bash
# Replace YOUR_API_KEY with your actual key
curl -X POST https://api.exchangetoken.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
  "model": "gemini-2.5-flash",
  "messages": [
    {"role": "system", "content": "You are a helpful AI assistant"},
    {"role": "user", "content": "What is Gemini?"}
  ],
  "temperature": 0.7
}'

🚀 Response time under 500ms

💻 Complete Examples in Various Languages

python
# Install: pip install openai
from openai import OpenAI

# Initialize client
client = OpenAI(
    api_key="YOUR_API_KEY",  # Get from ExchangeToken API
    base_url="https://api.exchangetoken.ai/v1"  
)

# Example of calling different models
def test_models():
    models = [
        "gpt-4.1-mini",  # Best Value
        "claude-sonnet-4",  # Best for Coding
        "deepseek-v3"  # Top Chinese Model
    ]
    
    for model in models:
        try:
            response = client.chat.completions.create(
                model=model,
                messages=[
                    {"role": "system", "content": "You are a helpful AI assistant"},
                    {"role": "user", "content": "Introduce yourself in one sentence"}
                ],
                temperature=0.7,
                max_tokens=100
            )
            print(f"{model}: {response.choices[0].message.content}")
            print(f"Tokens used: {response.usage.total_tokens}\n")
        except Exception as e:
            print(f"{model} Call failed: {e}\n")

if __name__ == "__main__":
    test_models()