For /v1/responses, see Using the Responses API. The other examples on this page use Chat Completions.
Make your first Solar API call, understand the response, and learn how to continue a conversation.
Before you begin
You need an Upstage account and API key. If you do not have them yet, follow Getting Started.
Install an OpenAI SDK
Solar is compatible with the OpenAI API. Before using the Solar API, install the official OpenAI SDK for your language.
Make your first request
Start using the Solar API by sending a simple greeting.
Request
Understand the response
The generated answer is in choices[0].message.content. Solar Pro 4 keeps reasoning off by default; set reasoning_effort to also receive the reasoning trace in the responseβsee Reasoning.
| Field | Description |
|---|---|
choices[0].message.content | The generated answer text. |
choices[0].message.reasoning | The reasoning trace the model produced before answering. |
choices[0].finish_reason | Why generation stopped. stop means the model finished on its own. |
model | The exact model version that handled the request. |
usage.prompt_tokens | Number of tokens in the request. |
usage.completion_tokens | Number of tokens in the generated answer, including reasoning tokens. |
usage.completion_tokens_details.reasoning_tokens | Number of tokens spent on reasoning. |
usage.total_tokens | Sum of prompt and completion tokens. |
For the complete response schema, see the Chat Completions API reference.
What models does Upstage provide?
The table below describes the models currently available as an API. Upstage provides stable aliases that point to specific model versions. These aliases let you integrate once and automatically benefit from future updates without needing to modify your code whenever a model is improved or replaced.
We recommend using aliases instead of hardcoding specific model names, as models are frequently updated. However, please note that model behavior may change slightly when an alias is updatedβfor example, in how prompts are handled or how outputs are structured. While we strive to ensure smooth transitions, we recommend validating key prompts and responses when using aliases in production.
| Alias | Currently points to | RPM / TPM (Learn more) |
|---|---|---|
| solar-pro4 | solar-pro4-260806 | 100 / 250,000 |
| solar-mini4 | solar-mini4-260922 | 100 / 50,000 |
| syn-pro | syn-pro-251021 | 100 / 50,000 |
Continue the conversation
Chat Completions is stateless: it does not store your conversation history. Each request is handled on its own, so the model only knows what you send in messages.
To keep context across turns, resend the previous user and assistant messages together with the new user message.
Every resent message counts toward your input tokens, so a long conversation costs more with each turn. As the conversation approaches the model's context limit, trim or summarize older turns.
Stream the response
Streaming lets your application display text as it is generated, instead of waiting for the complete response. Each chunk carries a piece of the answer, so the first words appear within a moment.
With the OpenAI SDK, each chunk exposes its text at choices[0].delta.content. When reasoning is on via reasoning_effort, the reasoning trace streams first in choices[0].delta.reasoning, before the answer chunks arrive. LangChain and LlamaIndex use their own chunk interfaces, as shown above. Raw SSE streams, including the cURL example, finish with data: [DONE].
Using the Responses API
The Responses API is available on Solar Pro 4 and Solar Mini 4.
This API stores nothing, so a conversation is continued by sending the whole history. Append the previous response's output items to your input, then add the new user message. previous_response_id and conversation are rejected with a 400.
reasoning items may appear in output. Sending them back is safe β they are ignored, and reasoning is re-derived on each turn.
Next steps
Now that your first request works, explore the capabilities you can build on top of it.
Overview
Overview of building with Solar on Upstage β make your first API call, choose a model, add reasoning, structured outputs, and tool calling, then ship to production.
Reasoning
When to let Solar reason before answering, and how reasoning_effort trades extra tokens and latency for multi-step accuracy.