Prerequisites
- A QWave API account (sign up)
- An API key
- Basic programming knowledge
Get an API Key
Create a key
On the API keys page, click “Create new key”
Save your key
Copy the key and store it somewhere safe — it’s only shown once
Never expose your API key in frontend code or public repositories.
Send Your First Request
QWave API is fully compatible with the OpenAI SDK — just swap the base_url.
from openai import OpenAI
client = OpenAI(
base_url="https://www.qingbo.dev/v1",
api_key="YOUR_API_KEY"
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "user", "content": "你好,介绍一下你自己"}
]
)
print(response.choices[0].message.content)
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://www.qingbo.dev/v1',
apiKey: 'YOUR_API_KEY'
});
const response = await client.chat.completions.create({
model: 'gpt-4o',
messages: [
{ role: 'user', content: '你好,介绍一下你自己' }
]
});
console.log(response.choices[0].message.content);
curl https://www.qingbo.dev/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "你好,介绍一下你自己"}
]
}'
Understanding the Response
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"model": "gpt-4o",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!我是一个 AI 助手..."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 12,
"total_tokens": 21
}
}
Next Steps
Authentication & Keys
Learn about authentication and API key management
Sync vs. Async
Understand the two endpoint patterns
Text Generation API
Full chat API reference and parameters
Task System
The async workflow for image and video generation