We now support the Qwen3-Coder-480B-A35B model (model identifier: Qwen3-Coder), which is optimized for code generation and understanding, featuring a 256k context length and 64k maximum output length. It supports tools like Claude Code, Cline, Roo Code and more.
Quick Start
iFlow API provides 100% OpenAI-compatible interface services, allowing you to seamlessly switch to our AI services for higher performance and more cost-effective solutions.
Step 1: Get Your API Key
- Visit iFlow and complete registration and login
- Generate your exclusive API KEY by clicking
Personal Information
menu on the user settings page - Safely store the API KEY for subsequent API calls
💡 Tip: The API KEY has full account permissions. Do not disclose it to others.
Step 2: Understand Supported Models
We provide a variety of high-performance AI models for you to choose from. To get the latest model information, detailed parameter configurations, and usage instructions, please visit our models page:
Click to view all supported models
On the models page, you can:
- View detailed information about all available models
- Learn about context length and output limits for each model
- Check model performance characteristics and applicable scenarios
- Copy model ID for API calls
Step 3: Configure API Parameters
Use the following configuration information to call the iFlow API:
Parameter Name | Parameter Value | Description |
---|---|---|
HTTP URL | https://apis.iflow.cn/v1/chat/completions | Chat interface, supports streaming and non streaming |
API Key | your key | Obtain from Console, click Personal Information menu on the user settings page |
OpenAi Base URL | https://apis.iflow.cn/v1 | OpenAI SDK usage |
Step 4: Start Calling the API
Basic Examples
Here are examples of calling the iFlow API using different programming languages:
- OpenAI-Python
- OpenAI-TypeScript
- Bash/cURL
- Python
- JavaScript
from openai import OpenAI
client = OpenAI(
base_url="https://apis.iflow.cn/v1",
api_key="<YOUR_IFLOW_API_KEY>",
)
completion = client.chat.completions.create(
extra_body={},
model="TBStars2-200B-A13B",
messages=[
{
"role": "user",
"content": "What is the meaning of life?"
}
]
)
print(completion.choices[0].message.content)
import OpenAI from 'openai';
const openai = new OpenAI({
baseURL: "https://apis.iflow.cn/v1",
apiKey: "<YOUR_IFLOW_API_KEY>"
});
async function main() {
const completion = await openai.chat.completions.create({
model: "TBStars2-200B-A13B",
messages: [
{
"role": "user",
"content": "What is the meaning of life?"
}
],
});
console.log(completion.choices[0].message);
}
main();
curl https://apis.iflow.cn/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "TBStars2-200B-A13B",
"messages": [
{"role": "system", "content": "You are a professional AI assistant."},
{"role": "user", "content": "Please introduce the history of artificial intelligence development"}
],
"temperature": 0.7,
"max_tokens": 1000
}'
import requests
# Configure API
url = "https://apis.iflow.cn/v1/chat/completions"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
# Request data
data = {
"model": "TBStars2-200B-A13B",
"messages": [
{"role": "user", "content": "Explain the basic principles of quantum computing"}
],
"temperature": 0.7,
"max_tokens": 1000
}
# Make request
response = requests.post(url, json=data, headers=headers)
result = response.json()
# Print result
print(result["choices"][0]["message"]["content"])
const response = await fetch('https://apis.iflow.cn/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'TBStars2-200B-A13B',
messages: [
{role: 'user', content: 'Write a Python implementation of the quicksort algorithm'}
],
temperature: 0.7,
max_tokens: 1000
})
});
const data = await response.json();
console.log(data.choices[0].message.content);
Next Steps
- 📖 Detailed Documentation: View the complete API Reference Manual
- 🔧 Advanced Configuration: Learn more about parameter configuration options
- 💬 Technical Support: Contact Us for help
🚀 Start Building: Now that you've mastered the basics, you can start integrating the iFlow API into your projects!