Skip to main content

Quickstart

Get started with the Bizora API in under 5 minutes.

Prerequisites

Step 1: Get Your API Key

  1. Log in to https://webapp-dev.bizora.ai
  2. Navigate to API Keys section
  3. Click Create API Key
  4. 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

ParameterTypeRequiredDescription
modelstringYesMust be "bizora-1.0"
messagesarrayYesArray of message objects
streambooleanNoEnable streaming (default: false)
webSearchbooleanNoEnable 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

Need Help?