Skip to main content

Chat Completions API

Send messages and get AI responses for tax research questions.

Endpoint

POST /chat/completions

Base URL: https://api-bizora.ai

Authentication

Authorization: Bearer sk_live_YOUR_API_KEY

Request Parameters

ParameterTypeRequiredDescription
modelstringYesMust be "bizora-1.0"
messagesarrayYesArray of message objects
streambooleanNoEnable streaming (default: false)
askModestringNoCanonical mode selector such as tax_research_fast_research, tax_research_deep_research, or auto
allowedAskModesarrayNoConstrain auto-routing when askMode is auto
ZeroDataRetentionbooleanNoDisabled by default. Pass true only if you require zero data retention.

Parameter Usage by Platform

Python SDK:

  • Use extra_body={"askMode": "tax_research_deep_research"} for deep research

JavaScript SDK:

  • Use askMode: "tax_research_deep_research" directly in the request object

HTTP/curl:

  • Include "askMode": "tax_research_deep_research" in the JSON body

Supported askMode Values

ValueBest for
tax_research_normalNormal first-party webapp tax research.
tax_research_fast_researchFast focused tax research; this is the platform API-key default.
tax_research_deep_researchDeep multi-step tax research for complex or high-stakes questions.
audit_researchComprehensive audit research on complex accounting standards and compliance.
autoBackend route selection. Use allowedAskModes to constrain routing.

Zero Data Retention

Zero data retention is disabled by default. To enable it for a specific request, pass ZeroDataRetention: true in the request body.

When enabled, prompt and response content is not retained for that request. Some models or providers may be unavailable because they do not support zero data retention. You should handle abuse monitoring for zero data retention traffic because Bizora has limited content visibility for those requests.

response = client.chat.completions.create(
model="bizora-1.0",
messages=[{"role": "human", "content": "What is section 179?"}],
extra_body={"ZeroDataRetention": True}
)

Message Format

Each message has a role and content:

{
"role": "human",
"content": "What is section 179?"
}

Supported roles:

  • human - User messages
  • ai - AI responses (for conversation history)

Multi-Turn Conversation Example

{
"model": "bizora-1.0",
"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?"}
]
}

Basic Examples

Simple Request

import openai

client = openai.OpenAI(
api_key="sk_live_YOUR_API_KEY",
base_url="https://api-bizora.ai"
)

response = client.chat.completions.create(
model="bizora-1.0",
messages=[{"role": "human", "content": "What is section 179?"}]
)

print(response.choices[0].message.content)
# Stream responses in real-time
stream = client.chat.completions.create(
model="bizora-1.0",
messages=[{"role": "human", "content": "What is section 179?"}],
stream=True
)

for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)

Deep Research Mode

# Enable deep research for complex tax analysis
response = client.chat.completions.create(
model="bizora-1.0",
messages=[{"role": "human", "content": "Analyze the tax treatment of cryptocurrency staking rewards and airdrops."}],
extra_body={"askMode": "tax_research_deep_research"}
)

print(response.choices[0].message.content)

Audit Research Mode

# Enable audit research for complex financial analysis
response = client.chat.completions.create(
model="bizora-1.0",
messages=[{"role": "human", "content": "Analyze the reporting requirements for lease modifications under ASC 842."}],
extra_body={"askMode": "audit_research"}
)

print(response.choices[0].message.content)

Constrained Auto-Routing

Use askMode: "auto" with allowedAskModes when you want Bizora to dynamically choose between explicitly permitted routes (e.g., fast tax research, deep tax research, and audit research). Note that you will be billed at the rate of whichever specific research mode is ultimately selected.

response = client.chat.completions.create(
model="bizora-1.0",
messages=[{"role": "human", "content": "Compare the Jarrett staking case with IRS guidance on crypto rewards."}],
extra_body={
"askMode": "auto",
"allowedAskModes": [
"tax_research_fast_research",
"tax_research_deep_research",
],
}
)

Response Format

Non-Streaming Response

{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1677652288,
"model": "bizora-1.0",
"choices": [{
"index": 0,
"message": {
"role": "ai",
"content": "Section 179 allows businesses to deduct..."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 500,
"total_tokens": 510
}
}

Token Usage

The usage object reports token usage for the request:

FieldDescription
prompt_tokensTokens from the user-provided input.
completion_tokensTokens in the final answer returned to the user.
total_tokensTotal tokens across input and output.

Streaming Response

Each chunk contains incremental content:

{
"id": "chatcmpl-abc123",
"object": "chat.completion.chunk",
"created": 1677652288,
"model": "bizora-1.0",
"choices": [{
"index": 0,
"delta": {
"content": "text chunk"
},
"finish_reason": null
}]
}

Legacy Compatibility & Deprecated Flags

For older integrations, the following deprecated fields and aliases are still accepted but not recommended for new implementations:

  • Legacy askMode Aliases:
    • normal (alias for tax_research_normal)
    • fast_research (alias for tax_research_fast_research)
    • web_search (alias for tax_research_web_search)
  • Legacy Boolean Flags:
    • websearch: true or webSearch: true (maps to tax_research_web_search)

Do not combine askMode with legacy boolean flags.

Next Steps