import requests r = requests.post( "https://api.aimlapi.com/v1/chat/completions", headers={"Authorization": "Bearer " + AIMLAPI_KEY}, json={ "model": "upstage/solar-mini4", "messages": [ { "role": "user", "content": "Hello!" } ] }, ) print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/chat/completions", { method: "POST", headers: { Authorization: `Bearer ${process.env.AIMLAPI_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "model": "upstage/solar-mini4", "messages": [ { "role": "user", "content": "Hello!" } ] }), }); console.log(await r.json());
curl -X POST https://api.aimlapi.com/v1/chat/completions \ -H "Authorization: Bearer $AIMLAPI_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"upstage/solar-mini4","messages":[{"role":"user","content":"Hello!"}]}'
OpenAI-compatible — swap the base URL and it works with your existing SDK.
| Type | Price |
|---|---|
| Input | |
| Output | |
| Cached input |
Agentic pipelines. Multi-step loops that plan, call tools and check their own work. Parallel tool calls mean a single step can fire several tool invocations at once, and the cached-input rate keeps the repeated system prompt from dominating the bill across thirty or forty steps.
Long-document analysis. Contracts, filings, research papers and support archives go into a single request rather than through a chunk-embed-rerank pipeline, because 524,288 tokens covers roughly 1,500 pages.
Repository-scale code work. Code review, test generation and mechanical migrations across a mid-sized codebase, with room for a 131,072-token reply when the answer is a large diff rather than a comment.
Structured extraction at volume. Turning invoices, tickets or product feeds into schema-conformant JSON, at a price where running the job across millions of records is affordable.
| Model | Input | Output | Context | Best for |
|---|---|---|---|---|
Solar Mini 4 This page | Agentic workflows on a budget | |||
| Agentic workflows, coding & document analysis | ||||
| Reasoning + agents | ||||
| Fast, high-volume tasks |
Solar Mini 4 is Upstage's compact language model: a 35-billion-parameter mixture-of-experts with 3 billion active parameters and a 524,288-token context window. It is built for agentic use cases where cost per step matters.
On AI/ML API, Solar Mini 4 costs $0.13754 per 1M input tokens and $0.55016 per 1M output tokens. Cached input is billed at $0.013754 per 1M tokens.
Solar Mini 4 accepts up to 524,288 tokens in a single request and can return up to 131,072 tokens, so long documents and large codebases fit without chunking.
It is a text-in, text-out model with reasoning, streaming, structured outputs, tool calling and parallel tool calls — the pieces an agent loop needs to plan, call tools and verify its own work.
Send a POST request to https://api.aimlapi.com/v1/chat/completions with upstage/solar-mini4 as the model id and your AI/ML API key in the Authorization header. The endpoint is OpenAI-compatible, so existing chat completion clients work unchanged.