API
Moving an OpenAI SDK app to TogoMind
Most of the work is two lines of configuration. The rest is knowing which parts of the app depend on something the endpoint does not offer.
TogoMind exposes an OpenAI-compatible API at https://togomind.com/api/v1. If your application already uses an OpenAI SDK client — in Python, JavaScript or anything else that speaks the same protocol — it does not need a new library. It needs a different address, a different key and different model names.
Step one: base URL and API key
Create an API key in the dashboard. Then point the client at TogoMind. In the Python SDK that means constructing the client with base_url set to "https://togomind.com/api/v1" and api_key set to your TogoMind key. In the JavaScript SDK the options are baseURL and apiKey, with the same values. Calls without an SDK send the key as a Bearer token in the Authorization header.
Keep the key out of source code. Read it from an environment variable, as you presumably already do for the key it replaces.
Step two: model ids
Replace the model name in each call with a TogoMind tier id. A reasonable first mapping:
- General writing, summaries and translation: core-standard. This is the default and the one to start with.
- High-volume classification, tagging and short replies: core-fast.
- Complex writing and careful analysis: core-pro.
- Maths, planning and decisions that need step-by-step thinking: core-reason.
- Code, SQL and scripts: core-code.
- Whole documents: core-long, with a 1,000,000-token window.
- Images: core-vision.
- Embeddings: core-embed.
If model names are scattered through the codebase, this is a good moment to move them into one configuration value per job. It makes the next change of tier a one-line edit.
Chat completions
POST /chat/completions works as you expect: a model, a messages array with system, user and assistant roles, and the usual response with choices and a usage object. The usage object carries the prompt and completion token counts, and the same counts appear in your request log with the exact cost.
Embeddings
POST /embeddings takes model "core-embed" and an input that is either one string or a list of strings — up to 100 inputs per request, each up to 2,048 tokens. The optional dimensions parameter asks for shorter vectors when your storage or index wants them. If your app sends embeddings one string at a time, grouping them into lists of up to 100 cuts the number of round trips.
Images
core-vision takes images as content parts in a user message, in the same shape the SDK already uses: a part of type "image_url" whose url is a data URL such as "data:image/png;base64,…", alongside a text part with the question. PNG, JPEG and WebP are accepted, up to 10 images per request and 7 MB each. If your app currently passes ordinary web links to images, fetch the image and encode it as a data URL before sending.
What to check before switching traffic
- Only two endpoints exist: chat completions and embeddings. Code paths that call any other endpoint of the protocol — file upload, image generation, training jobs and the like — have no equivalent here and need to be removed or kept elsewhere.
- Context windows differ by tier. core-code accepts 32,768 tokens, core-standard 131,072. A prompt that fits one tier may be rejected by another; the window is enforced, not truncated.
- Requests need credit. A request whose input alone would cost more than the balance is refused before it runs. Handle that response the way you handle any other refused request, and top up before a known large job.
- Compare outputs, not just status codes. Run a sample of your real prompts through the new tier, read the answers side by side with the old ones, and change the prompt where the difference matters.
The playground in the dashboard is the quickest place to try a prompt against several tiers before changing any code. And requests sent to TogoMind are not used to train models, which is worth stating to whoever signs off on the move.
More
Keep reading
Start
Try it on your own prompts
Sign up free, no card, and get ten real Core Fast answers a day. Top up from $1 for the other tiers; every request shows what it cost.