Keep your key on your server.
Create a scoped key in the ByteAI workspace. Send it as a bearer token from your backend. Do not put API keys in browser code or mobile bundles.
curl https://api.byteai.in/v1/chat/completions \
-H "Authorization: Bearer $BYTEAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-gray",
"messages": [{"role":"user","content":"Explain this clearly."}]
}'OpenAI-compatible chat, with ByteAI metadata.
/v1/chat/completionsRequires a key with the complete scopeUse gpt-gray or gpt-gray-1.0. Requests accept a conversation, optional specialization, optional web search, and a streaming flag. The response follows the chat completion shape and includes model version and ByteAI source metadata.
{
"model": "gpt-gray",
"messages": [{"role":"user","content":"What changed recently?"}],
"web_search": true,
"specialization": "research",
"stream": false
}When streaming is enabled, the endpoint emits server-sent event chunks and ends with [DONE]. ByteAI also emits source metadata in a byteai field. Search availability depends on server configuration; never treat web page text as instructions.
POST /v1/public/chat without an API key. It has a smaller daily allowance. Product integrations should use the authenticated chat completions endpoint above.{
"id": "chatcmpl_…",
"object": "chat.completion",
"model": "gpt-gray",
"model_version": "1.0",
"choices": [{"message":{"role":"assistant","content":"…"},"finish_reason":"stop"}],
"byteai": {"search_provider":"…","grounded":true,"sources":[…]}
}Find information. Keep the source trail.
For product-integrated research, call chat with web_search: true or use POST /v1/search. Source results are returned separately so your application can render links and review them. Search is controlled by deployment configuration.
/v1/modelsPublic model metadataThe model list reports the current default, release version, and capabilities.
Focused tools for real workflows.
/v1/tasks/completeRun a focused text task with a system and user prompt.
/v1/tasks/composeDraft a professional email from instructions and context.
/v1/tasks/replyDraft a safe email reply with tone and instruction controls.
/v1/tasks/rewriteRewrite user supplied text in a selected style.
/v1/tasks/summarizeSummarize an email and list its key points or decisions.
/v1/tasks/suggest_repliesSuggest three concise email responses.
/v1/tasks/subjectGenerate three email subject line options.
/v1/tasks/translateTranslate text into the requested language.
/v1/tasks/extractExtract tasks, dates, and people from an email.
/v1/tasks/classifyClassify email priority, intent, and reply needs.
/v1/tasks/autoreplyDraft a conservative acknowledgement or return SKIP.
/v1/tasks/extract_questionsExtract, clean, and classify supported question formats.
/v1/tasks/refine_questionsImprove wording while preserving source meaning and intent.
/v1/tasks/structure_paperSuggest paper sections, visual placement, and review flags.
/v1/tasks/generate_optionsGenerate answer options and a checked answer key.
/v1/vision/ocrTranscribe scans and handwriting with confidence and review status.
/v1/vision/diagram/evaluateCompare diagram evidence against supplied labels or criteria.
/v1/evaluations/subjectiveEvaluate typed or transcribed responses against a rubric.
/v1/searchSearch the web using configured providers and return source metadata.
All /v1/tasks/:task requests require the complete scope. Vision endpoints require vision; web search accepts a search scoped key or a ByteAI session. Task and vision endpoints use JSON request and response bodies. Check the task schema before sending data. Image endpoints accept supported image inputs and return uncertainty or review flags where applicable.
Errors should be actionable.
Common responses include 400 invalid_input, 401 unauthorized, 429 daily_limit_reached, 502 generation_failed, and 503 temporarily_unavailable. Retry transient 502/503 responses with bounded exponential backoff and an idempotency strategy where your workflow supports one.
Text extraction, OCR, diagram interpretation, and subjective scoring can be uncertain. ByteAI returns confidence guidance or review flags where available. Keep a human review step for consequential grading and source-sensitive outputs.