Skip to main content
MITHUNAI does not publish an SDK or client library for any language, and you do not need one: the HTTP API is plain JSON over HTTPS, authenticated with Authorization: Bearer mithunai_sk_…, and answers stream as standard server-sent events, so the HTTP client you already have is enough. A package named @mithunai/sdk on npm or mithunai on PyPI is not published by MITHUNAI; do not install one expecting it to be.

Ask a question and stream the answer

Two calls: create a conversation with an assistant, then post the question to its :stream endpoint. The stream ends with exactly one terminal event, answer.completed, answer.interrupted or answer.error.
A Python version of the same stream, and the rules a client can rely on, are on Streaming. For a single JSON response instead of a stream, use Send a message; the HTTP API guide has a complete ask() helper in Python and Node.js.

What a library would have done for you

Handle these in your own client:
  • Retries. Retry 429 after the Retry-After header, and retry network failures with the same idempotency_key, so a repeated question returns the stored answer instead of asking twice. See Rate limits.
  • Errors. Every error body is {"code": …, "message": …} with a stable code. See Errors.
  • Types. The request and response fields are listed on each API reference page. Ignore fields and event types you do not recognise; new optional ones can be added within v1.
  • Abstention. abstained: true is a successful answer, not an error. Show it; do not retry it.
Call the API from your backend. An API key is a secret and must never reach a browser or a mobile app. For a browser, use the website widget.
Last modified on November 7, 2026