# Quickstart

Six steps from signing up to the model's first answer. This is the quickstart of the [Model API](/docs/model-api); your organization's agents are called through the [Agent API](/docs/openai-compatible).

### Top up the balance

[Sign up](/signup) and top up the organization balance in the [developer console](https://platform.samreshuuu.ru), section Balance: by card or by invoice for a company, from 100 ₽ at a time. A call costs what the host that answered it charges, plus our 20%: prices on the [Models](/models) page already include it. There is no top-up fee, the whole amount goes on the balance. The unspent balance is refunded in full, see [the balance in the help center](/help/billing#organization-balance).

### Issue a key

In the [developer console](https://platform.samreshuuu.ru), section API keys, create a key with the Model API access: it calls models and pays from the balance, and opens neither the agent nor the integrations. The key is shown once, so save it.

### Put the key in the environment

```bash
export SAMRESHUUU_API_KEY="sk-org-your_api_key"
```

### Call a model

The sample model is `deepseek/deepseek-v4.1-flash`; pick any other on the [Models](/models) page.

**cURL**

```bash
curl https://api.samreshuuu.ru/v1/chat/completions \
  -H "Authorization: Bearer $SAMRESHUUU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek/deepseek-v4.1-flash","messages":[{"role":"user","content":"Hi! What can you do?"}]}'
```

**Python**

```python
import os
from openai import OpenAI

client = OpenAI(api_key=os.environ["SAMRESHUUU_API_KEY"], base_url="https://api.samreshuuu.ru/v1")

reply = client.chat.completions.create(
    model="deepseek/deepseek-v4.1-flash",
    messages=[{"role": "user", "content": "Hi! What can you do?"}],
)
print(reply.choices[0].message.content)
print(reply.usage)
```

**Node.js**

```typescript
import OpenAI from "openai";

const client = new OpenAI({ apiKey: process.env.SAMRESHUUU_API_KEY, baseURL: "https://api.samreshuuu.ru/v1" });

const reply = await client.chat.completions.create({
    model: "deepseek/deepseek-v4.1-flash",
    messages: [{ role: "user", content: "Hi! What can you do?" }],
});
console.log(reply.choices[0].message.content);
console.log(reply.usage);
```

**Anthropic SDK**

```python
import os
from anthropic import Anthropic

client = Anthropic(api_key=os.environ["SAMRESHUUU_API_KEY"], base_url="https://api.samreshuuu.ru")

reply = client.messages.create(
    model="deepseek/deepseek-v4.1-flash",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hi! What can you do?"}],
)
print(reply.content[0].text)
```

### Read the answer and its price

The answer carries `usage`: the tokens of the prompt and the answer, what was read from and written to the cache, and `usage.cost`, the exact price of the call in roubles. That is what the balance was charged.

```json
{
  "id": "gen-3f9c2a7e5b1d4c8a9e6f0b2d7a4c1e53",
  "object": "chat.completion",
  "created": 1794326400,
  "model": "deepseek/deepseek-v4.1-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! I can answer questions, write and edit text, and work with code."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 9,
    "completion_tokens": 12,
    "total_tokens": 21,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "cache_write_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    },
    "cost": 0.01,
    "cost_currency": "RUB"
  }
}
```

### See the call in the log

In the [developer console](https://platform.samreshuuu.ru), section Call log, every call of the key is listed: the model, the host that answered, the tokens, the price and the duration, refused calls too.

## Next

- [Streaming](/docs/model-api-requests#streaming): text as it is written.
- [Anthropic SDK and Claude Code](/docs/model-api#addresses): the same key, the address without a path.
- [A model's hosts](/docs/model-api#a-models-hosts-and-their-availability): who answers the call and at what price.
- [Agent API](/docs/openai-compatible): your organization's agents with their tools and connections.
