01 / Quick start

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."}]
  }'
Store secrets in your host’s environment manager and rotate them from the workspace.
02 / Chat completions

OpenAI-compatible chat, with ByteAI metadata.

POST/v1/chat/completionsRequires a key with the complete scope

Use 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
}
generalstudywritingemailresearchexam-papercodingbusiness

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.

Limited guest chat is available at 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":[…]}
}
04 / Endpoint catalog

Focused tools for real workflows.

POST/v1/tasks/complete

Run a focused text task with a system and user prompt.

POST/v1/tasks/compose

Draft a professional email from instructions and context.

POST/v1/tasks/reply

Draft a safe email reply with tone and instruction controls.

POST/v1/tasks/rewrite

Rewrite user supplied text in a selected style.

POST/v1/tasks/summarize

Summarize an email and list its key points or decisions.

POST/v1/tasks/suggest_replies

Suggest three concise email responses.

POST/v1/tasks/subject

Generate three email subject line options.

POST/v1/tasks/translate

Translate text into the requested language.

POST/v1/tasks/extract

Extract tasks, dates, and people from an email.

POST/v1/tasks/classify

Classify email priority, intent, and reply needs.

POST/v1/tasks/autoreply

Draft a conservative acknowledgement or return SKIP.

POST/v1/tasks/extract_questions

Extract, clean, and classify supported question formats.

POST/v1/tasks/refine_questions

Improve wording while preserving source meaning and intent.

POST/v1/tasks/structure_paper

Suggest paper sections, visual placement, and review flags.

POST/v1/tasks/generate_options

Generate answer options and a checked answer key.

POST/v1/vision/ocr

Transcribe scans and handwriting with confidence and review status.

POST/v1/vision/diagram/evaluate

Compare diagram evidence against supplied labels or criteria.

POST/v1/evaluations/subjective

Evaluate typed or transcribed responses against a rubric.

POST/v1/search

Search 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.

05 / Reliability and review

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.

API documentation — ByteAI