Step 1: Create your Account
Access MixRoute or click [Get Started] in the top right corner to create your account.
- Step 1: Click “Sign Up” in the top right corner.
- Step 2: Enter your email address, set a password, and complete the verification.
- Step 3: Go to “Wallet Management” and complete your top-up (Stripe supported).
New users receive a $1 bonus upon registration
Step 2: Create API Key
- Click “Token Management” in the navigation
- Click “Add Token”
- Click “Submit” to generate a key
Step 3: Start Calling
3.1 Connection Info
| Config | Value |
|---|
| API URL (Base URL) | https://api.mixroute.ai/v1 |
| API Key | Your created key |
| Request Format | Fully OpenAI API compatible |
3.2 Test Call
Quick test with curl:
curl https://api.mixroute.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello!"}]
}'
3.3 Code Examples
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.mixroute.ai/v1"
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)
import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: 'YOUR_API_KEY',
baseURL: 'https://api.mixroute.ai/v1'
});
const response = await openai.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'Hello!' }]
});
console.log(response.choices[0].message.content);
OpenAiService service = new OpenAiService(
"YOUR_API_KEY",
Duration.ofSeconds(60),
"https://api.mixroute.ai/v1"
);
ChatCompletionRequest request = ChatCompletionRequest.builder()
.model("gpt-4o")
.messages(List.of(
new ChatMessage(ChatMessageRole.USER, "Hello!")
))
.build();
ChatCompletionResult result = service.createChatCompletion(request);
System.out.println(result.getChoices().get(0).getMessage().getContent());
Next Steps
Congratulations! You’ve successfully set up MixRoute API. Then you can:
View API Docs
Learn about complete API specifications
Integration
Integrate MixRoute API with various tools
Save your API key safely and regularly check usage logs in the console to optimize costs. Happy coding!