API Reference
Endpoints, parameters, and response schemas.
https://oiv1.bcworks.in.net
Endpoints
GET
/health
Check API status and model availability. No auth required.
Example request
bash
curl https://oiv1.bcworks.in.net/health
Example response
json
{
"status": "healthy",
"version": "1.0.0",
"models_loaded": {
"vision": true,
"language": true,
"database": true
}
}
POST
/v1/chat/completions
Generate a chat response. Returns the top reply and token usage.
Example request
bash
curl -X POST https://oiv1.bcworks.in.net/v1/chat/completions \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"messages":[{"role":"user","content":"Hello"}]}'
Example response
json
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "OIv1",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hi there!"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 8,
"completion_tokens": 4,
"total_tokens": 12
}
}
Request body
messages required
array
List of message objects with
role and content.
max_tokens optional
integer
Max tokens to generate. Default: 150.
temperature optional
float
Sampling temperature 0.0-1.0. Default: 0.7.
Message object
role required
string
"system", "user", or "assistant".
content required
string
The text content.
image optional
string
Base64 data URI:
data:image/jpeg;base64,...
Multimodal request
json
{
"messages": [{
"role": "user",
"content": "What is in this image?",
"image": "data:image/jpeg;base64,/9j/4AAQ..."
}],
"max_tokens": 200
}
Error responses
| Code | Meaning | Example |
|---|---|---|
400 | Bad Request | {"detail":{"error":{"message":"messages field required"}}} |
401 | Unauthorized | {"detail":{"error":{"message":"Invalid API key","code":"invalid_api_key"}}} |
429 | Rate Limited | {"detail":{"error":{"message":"Rate limit exceeded","code":"rate_limit"}}} |
500 | Server Error | {"detail":{"error":{"message":"Internal server error"}}} |
Try It
Send a test request
Response will appear here.
Client-side only. Your key is sent directly to the API and never stored.
API Keys
Create and manage keys at oi.bcworks.in.net. Sign in with Clerk, then generate keys from the dashboard. Each key is linked to your account for usage tracking.
Rate Limits
| Tier | Requests/min | Max tokens |
|---|---|---|
| Free | Unlimited | 2048 |