Quick Start Guide
Guides
π Get Your API Key
Sign up at barqapi.com/signup. After email verification, you'll receive $5 free credit and your API key instantly.
Make Your First Request
Barq is 100% OpenAI-compatible. If you've used the OpenAI API, you already know how to use Barq β just change the base URL and API key.
cURL
curl https://api.barqapi.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $BARQ_API_KEY" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello, Barq!"}]
}'
Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.barqapi.com/v1",
api_key="your-barq-api-key"
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello, Barq!"}]
)
print(response.choices[0].message.content)
JavaScript / Node.js
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: "https://api.barqapi.com/v1",
apiKey: "your-barq-api-key"
});
const completion = await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Hello, Barq!" }]
});
console.log(completion.choices[0].message.content);
Next Steps
- Browse available models (we support 40+ models from OpenAI, Anthropic, Google, DeepSeek, and more)
- Check streaming support for real-time responses
- Review rate limits for your plan