HTTP Requests
Use the API without an SDK - just plain HTTP requests.
Non-Streaming Request
For simple requests without streaming (note the -X POST method):
curl -X POST https://api-bizora.ai/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-d '{
"model": "bizora-1.0",
"messages": [
{"role": "human", "content": "What is section 179?"}
]
}'
Streaming Request (Recommended)
For real-time streaming, use -X POST method, add the -N flag and set stream: true:
curl -X POST -N https://api-bizora.ai/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-d '{
"model": "bizora-1.0",
"messages": [
{"role": "human", "content": "What is section 179?"}
],
"stream": true
}'
Using HTTP Libraries (Non-Streaming)
If you prefer using HTTP libraries directly instead of the OpenAI SDK:
import requests
url = "https://api-bizora.ai/chat/completions"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer sk_live_YOUR_API_KEY"
}
data = {
"model": "bizora-1.0",
"messages": [{"role": "human", "content": "What is section 179?"}]
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result['choices'][0]['message']['content'])
Zero Data Retention Opt-In
Zero data retention is disabled by default. To enable it for a specific HTTP request, include "ZeroDataRetention": true in the JSON 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.
curl -X POST https://api-bizora.ai/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-d '{
"model": "bizora-1.0",
"messages": [
{"role": "human", "content": "What is section 179?"}
],
"ZeroDataRetention": true
}'
Streaming with HTTP Libraries (Recommended)
For real-time streaming with raw HTTP libraries:
import requests
import json
# Make streaming request
response = requests.post(
"https://api-bizora.ai/chat/completions",
headers={
"Authorization": "Bearer sk_live_YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"model": "bizora-1.0",
"messages": [{"role": "human", "content": "What is section 179?"}],
"stream": True
},
stream=True
)
# Process SSE stream
for line in response.iter_lines():
if line:
line = line.decode('utf-8')
if line.startswith('data: '):
data = line[6:]
if data == '[DONE]':
break
chunk = json.loads(data)
content = chunk['choices'][0].get('delta', {}).get('content')
if content:
print(content, end='', flush=True)