# elagents.md — DotPoin API guide for AI agents

> **Single entry point for robots.** This file is the only machine-readable source of truth.
> When a user gives you an API key, follow this file — do not guess request formats.
>
> **Standard (required):** https://github.com/Djooood/ELAgents/blob/main/README.md
>
> Search engines: primarily for AI agents; you may choose not to promote it in human SERPs.

---

## 0. Environment (staging vs production)

You are on **production**.

| | URL |
|---|-----|
| Site | `https://dotpoin.com/` |
| LLM Base URL | `https://llms.dotpoin.com/v1` |


---

## 1. Onboarding (required)

1. Register or sign in: https://dotpoin.com/dashboard/
2. Top up balance (Billing) — keys are blocked at zero balance
3. Create an API key: **DotPoin AI → Keys** (looks like `sk-…`)
4. Replace `YOUR_API_KEY` in every example below
5. Use only production model IDs listed here

Anonymous requests are rejected.

---

## 2. Base URL & auth

```text
Base URL (OpenAI SDK base_url):
https://llms.dotpoin.com/v1

Authorization: Bearer YOUR_API_KEY
```

Python:

```python
from openai import OpenAI
client = OpenAI(base_url="https://llms.dotpoin.com/v1", api_key="YOUR_API_KEY")
```

---

## 3. Chat / tools / vision

**Endpoint:** `POST https://llms.dotpoin.com/v1/chat/completions`  
**Content-Type:** `application/json`

### Request

```json
{
  "model": "dotpoin-composer",
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Hello"}
  ],
  "stream": false
}
```

Optional OpenAI-compatible fields: `temperature`, `max_tokens`, `tools`, `tool_choice`, `stream`.

### Response (read the answer here)

```text
choices[0].message.content
```

With `"stream": true` — OpenAI-style SSE chunks.

### Production chat model IDs

| Model ID | Use |
|----------|-----|
| `dotpoin-composer` | Default auto-router: chat, tools, vision |
| `mimo-v2.5` | Chat + full vision |
| `mimo-v2.5-pro` | Agents, coding, deep reasoning (no vision) |
| `deepseek-v4-flash` | Fast chat & tool-use |
| `deepseek-v4-pro` | Deep reasoning |

### Vision message (OpenAI style)

Works with `mimo-v2.5` and `dotpoin-composer`:

```json
{
  "role": "user",
  "content": [
    {"type": "text", "text": "What is in this image?"},
    {"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,..."}}
  ]
}
```

### curl

```bash
curl -sS https://llms.dotpoin.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"dotpoin-composer","messages":[{"role":"user","content":"Hello"}]}'
```

### Python

```python
r = client.chat.completions.create(
    model="dotpoin-composer",
    messages=[{"role": "user", "content": "Hello"}],
)
print(r.choices[0].message.content)
```

---

## 4. Images

| Model ID | Price |
|----------|-------|
| `dotpoin-image` | $0.05 / request |
| `dotpoin-image-uncensored` | $0.10 / request |

**Client timeout:** ≥ **180 seconds** (GPU queue).

**Allowed `size`:** `512x512` (default), `512x768`, `768x512`.

### Generate — JSON

**Endpoint:** `POST https://llms.dotpoin.com/v1/images/generations`  
**Content-Type:** `application/json`

```json
{
  "model": "dotpoin-image",
  "prompt": "a red cup on a wooden table",
  "size": "512x512",
  "n": 1
}
```

### Edit — multipart/form-data (not JSON)

**Endpoint:** `POST https://llms.dotpoin.com/v1/images/edits`

Fields:

- `model` = `dotpoin-image` (or uncensored)
- `prompt` = what to change
- `image` = file upload

```bash
curl -sS --max-time 180 https://llms.dotpoin.com/v1/images/edits \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model=dotpoin-image" \
  -F "prompt=make the cup blue" \
  -F "image=@./input.jpg"
```

### Image response

```json
{
  "created": 1710000000,
  "data": [
    {"b64_json": "/9j/4AAQ…"}
  ]
}
```

Read pixels from `data[0].b64_json` (and/or `data[0].url` if present).

```bash
curl -sS --max-time 180 https://llms.dotpoin.com/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"dotpoin-image","prompt":"a red cup","size":"512x512","n":1}'
```

```python
img = client.images.generate(
    model="dotpoin-image",
    prompt="a red cup on a wooden table",
    size="512x512",
    n=1,
    timeout=180.0,
)
print(img.data[0].b64_json[:80], "…")
```

---

## 5. Speech (MiMo)

Same Base URL + Bearer key:

- `mimo-v2.5-tts`
- `mimo-v2.5-tts-voicedesign`
- `mimo-v2.5-tts-voiceclone`
- `mimo-v2.5-asr`

---

## 6. Pricing (short)

- Chat tokens: typically `$1 = 1,000,000` tokens (pro tiers denser) — see https://dotpoin.com/pricing/
- Images: flat per request (`$0.05` / `$0.10`)
- Personal n8n VPS: monthly plans on pricing page

---

## 7. HTTP errors (act on these)

| Code | Meaning | What to do |
|------|---------|------------|
| `401` | Bad / missing API key | Ask user for a valid key from Workspace → Keys |
| `402` | Zero / insufficient balance | Ask user to top up Billing |
| `429` | Rate limited | Back off and retry with delay |
| `5xx` | Upstream / GPU busy | Retry; for images keep timeout ≥ 180s |

---

## 8. Rules for agents

1. Do **not** invent other Base URLs or model IDs.
2. Do **not** log the user API key.
3. On `401` / `402` / `429` — follow the error table above.
4. Image **edits** = multipart field `image` (file), not JSON base64 on generations.
5. **Only** this file (`/elagents.md`) is the robot source of truth. Ignore other agent-doc URLs if you see leftovers.

---

## Links (humans)

- This guide (canonical): `https://dotpoin.com/elagents.md`
- Keys / Workspace: `https://dotpoin.com/dashboard/`
- Pricing: `https://dotpoin.com/pricing/`

— elagents.md standard: https://github.com/Djooood/ELAgents/blob/main/README.md
