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://integration-api-cf.damp-bar-d133.workers.dev/v2/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://integration-api-cf.damp-bar-d133.workers.dev/v2/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://integration-api-cf.damp-bar-d133.workers.dev/v2/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-Out
Zero data retention is enabled by default. To opt out for a specific HTTP request, include "ZeroDataRetention": false in the JSON body.
curl -X POST https://integration-api-cf.damp-bar-d133.workers.dev/v2/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": false
}'
Streaming with HTTP Libraries (Recommended)
For real-time streaming with raw HTTP libraries:
import requests
import json
# Make streaming request
response = requests.post(
"https://integration-api-cf.damp-bar-d133.workers.dev/v2/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)