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 API Keys section
- 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
Ask a tax question and get streaming responses in real-time:
import openai
# Initialize client with your API key
client = openai.OpenAI(
api_key="sk_live_YOUR_API_KEY",
base_url="https://integration-api-cf.damp-bar-d133.workers.dev/v2"
)
# Ask a tax question with streaming
stream = client.chat.completions.create(
model="bizora-1.0",
messages=[{"role": "human", "content": "What is section 179?"}],
stream=True
)
# Print the answer as it arrives
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
Step 4: Enable Streaming
Get responses in real-time as they're generated:
# Add stream=True to get responses in real-time
stream = client.chat.completions.create(
model="bizora-1.0",
messages=[{"role": "human", "content": "What is section 179?"}],
stream=True
)
# Print each chunk as it arrives
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
Step 5: Handle Custom Messages
When streaming, the API sends additional information like research steps, sources, and suggestions:
# Stream responses and get custom messages
stream = client.chat.completions.create(
model="bizora-1.0",
messages=[{"role": "human", "content": "What is section 179?"}],
stream=True
)
for chunk in stream:
# AI content - the actual answer
if chunk.choices and 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':
# Shows what the AI is doing
print(f"\n🔄 {chunk.custom_data.get('title')}")
elif msg_type == 'source_message':
# Shows which documents were referenced
sources = chunk.custom_data.get('content', [])
print(f"\n📚 {len(sources)} sources found")
elif msg_type == 'suggestions':
# Follow-up question suggestions
suggestions = chunk.custom_data.get('suggestions', [])
print(f"\n💡 {len(suggestions)} suggested questions")
Common Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Must be "bizora-1.0" |
messages | array | Yes | Array of message objects |
stream | boolean | No | Enable streaming (default: false) |
webSearch | boolean | No | Enable web search mode (default: false) |
Multi-Turn Conversations
Build context by including previous messages. Use "human" for user messages and "ai" for AI responses:
# Include conversation history for context
messages = [
{"role": "human", "content": "What is section 179?"},
{"role": "ai", "content": "Section 179 allows businesses to deduct the full purchase price of qualifying equipment..."},
{"role": "human", "content": "What are the dollar limits?"}
]
response = client.chat.completions.create(
model="bizora-1.0",
messages=messages
)
print(response.choices[0].message.content)
Next Steps
- MCP Server - Use Bizora with MCP-compatible clients
- Chat Completions API - Complete API documentation with streaming examples
- Error Handling - Handle errors properly
- Rate Limits - Understand rate limits
Need Help?
- Security Bugs: admin@bizora.ai
- Dashboard: https://webapp-dev.bizora.ai