Quick Start
API key + first request in under 5 minutes.
Get an API Key
Create an account
Visit oi.bcworks.in.net and sign in with Google, GitHub, or email.
Generate a key
Open the dashboard, click Create API Key, and copy the key.
Store it safely
Save in an environment variable or .env file. Never commit to version control.
Verify & Auth
Sanity check
bash
curl https://oiv1.bcworks.in.net/health
{"status":"healthy","models_loaded":{"vision":true,"language":true,"database":true}}
Set your key
bash
export OI_KEY="your_api_key_here"
Security
Never hard-code keys. Use env vars or .env files.
Send a Message
bash
curl -X POST https://oiv1.bcworks.in.net/v1/chat/completions \
-H "Authorization: Bearer $OI_KEY" \
-H "Content-Type: application/json" \
-d '{"messages":[{"role":"user","content":"What is machine learning?"}],"max_tokens":150}'
python
import os, requests
resp = requests.post(
"https://oiv1.bcworks.in.net/v1/chat/completions",
headers={"Authorization": f"Bearer {os.environ['OI_KEY']}"},
json={
"messages": [{"role": "user", "content": "What is machine learning?"}],
"max_tokens": 150
}
)
print(resp.json()["choices"][0]["message"]["content"])
javascript
const resp = await fetch("https://oiv1.bcworks.in.net/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.OI_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
messages: [{ role: "user", content: "What is machine learning?" }],
max_tokens: 150
})
});
const data = await resp.json();
console.log(data.choices[0].message.content);
Analyze an Image
python
import os, base64, requests
with open("photo.jpg", "rb") as f:
img = base64.b64encode(f.read()).decode()
resp = requests.post(
"https://oiv1.bcworks.in.net/v1/chat/completions",
headers={"Authorization": f"Bearer {os.environ['OI_KEY']}"},
json={
"messages": [{"role":"user","content":"Describe this image","image":f"data:image/jpeg;base64,{img}"}],
"max_tokens": 200
}
)
print(resp.json()["choices"][0]["message"]["content"])
Supported formats
JPEG, PNG, WebP. Max 10 MB; under 1 MB recommended.
Next Steps
- API Reference — full parameters, schemas, errors.
- Code Examples — Python, JS, Go, cURL, PHP, C# and more.
- Student Guide — tutorials and project ideas.