Quickstart
Get started with the Bizora API in under 5 minutes.
Prerequisites
- API key from https://webapp-dev.bizora.ai
- Python 3.7+ or Node.js 14+ (for SDK usage)
Step 1: Get Your API Key
- Log in to https://webapp-dev.bizora.ai
- Navigate to Developers → API Keys
- Click Create API Key
- Copy and save your key securely
Step 2: Install SDK (Optional)
Python
pip install openai
JavaScript/TypeScript
npm install openai
# or
yarn add openai
Step 3: Make Your First Request
Python
import openai
# Initialize client
client = openai.OpenAI(
api_key="sk_live_YOUR_API_KEY",
base_url="https://dev.api-bizora.ai/v1"
)
# Make a request
response = client.chat.completions.create(
model="bizora",
messages=[
{"role": "human", "content": "What is section 169?"}
]
)
# Print response
print(response.choices[0].message.content)
JavaScript
import OpenAI from 'openai';
// Initialize client
const client = new OpenAI({
apiKey: 'sk_live_YOUR_API_KEY',
baseURL: 'https://dev.api-bizora.ai/v1'
});
// Make a request
const response = await client.chat.completions.create({
model: 'bizora',
messages: [
{ role: 'human', content: 'What is section 169?' }
]
});
// Print response
console.log(response.choices[0].message.content);
cURL
curl https://dev.api-bizora.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-d '{
"model": "bizora",
"messages": [
{"role": "human", "content": "What is section 169?"}
]
}'
Step 4: Enable Streaming
Python
stream = client.chat.completions.create(
model="bizora",
messages=[{"role": "human", "content": "What is section 169?"}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
JavaScript
const stream = await client.chat.completions.create({
model: 'bizora',
messages: [{ role: 'human', content: 'What is section 169?' }],
stream: true
});
for await (const chunk of stream) {
if (chunk.choices[0]?.delta?.content) {
process.stdout.write(chunk.choices[0].delta.content);
}
}
Step 5: Handle Custom Messages
The API sends additional message types during streaming:
Python
stream = client.chat.completions.create(
model="bizora",
messages=[{"role": "human", "content": "What is section 169?"}],
stream=True
)
for chunk in stream:
# AI content
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
# Custom messages (steps, sources, suggestions)
elif hasattr(chunk, 'custom_data'):
msg_type = chunk.custom_data.get('type')
if msg_type == 'step_message':
print(f"\n🔄 {chunk.custom_data.get('title')}")
elif msg_type == 'source_message':
sources = chunk.custom_data.get('content', [])
print(f"\n📚 {len(sources)} sources")
elif msg_type == 'suggestions':
suggestions = chunk.custom_data.get('suggestions', [])
print(f"\n💡 {len(suggestions)} suggestions")
JavaScript
const stream = await client.chat.completions.create({
model: 'bizora',
messages: [{ role: 'human', content: 'What is section 169?' }],
stream: true
});
for await (const chunk of stream) {
// AI content
if (chunk.choices[0]?.delta?.content) {
process.stdout.write(chunk.choices[0].delta.content);
}
// Custom messages
else if (chunk.custom_data) {
const { type } = chunk.custom_data;
if (type === 'step_message') {
console.log(`\n🔄 ${chunk.custom_data.title}`);
}
else if (type === 'source_message') {
const sources = chunk.custom_data.content || [];
console.log(`\n📚 ${sources.length} sources`);
}
else if (type === 'suggestions') {
const suggestions = chunk.custom_data.suggestions || [];
console.log(`\n💡 ${suggestions.length} suggestions`);
}
}
}
Common Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Must be "<ModelName />" |
messages | array | Yes | Array of message objects |
stream | boolean | No | Enable streaming (default: false) |
Message Roles
Use "human" for user messages and "ai" for assistant messages:
messages = [
{"role": "human", "content": "What is section 169?"},
{"role": "ai", "content": "Section 169 refers to..."},
{"role": "human", "content": "What are the requirements?"}
]
Next Steps
- Chat Completions API - Complete API documentation with streaming examples
- Error Handling - Handle errors properly
- Rate Limits - Understand rate limits
Need Help?
- Email: support@api-bizora.ai
- Dashboard: https://webapp-dev.bizora.ai