> For the complete documentation index, see [llms.txt](https://sogni.gitbook.io/sogni-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sogni.gitbook.io/sogni-docs/sogni-intelligence/introduction.md).

# Introduction

## Sogni Intelligence

**Sogni Intelligence** is an OpenAI-compatible LLM inference service powered by the **Sogni Supernet** — a decentralized network of [GPU workers](https://docs.sogni.ai/sogni-fast-worker/about-sogni-fast-worker). \
\
The service is frequently updated with the latest open-source LLM models including the powerful [Qwen3.6-35B-A3B](https://huggingface.co/unsloth/Qwen3.6-35B-A3B-GGUF#qwen36-35b-a3b) released in April 2026. Sogni Intelligence supports multi-turn conversations, media analysis, streaming, and agentic decision making with tool calling.\
\
**Sogni Platform Tools:** Sogni Intelligence includes access to a powerful suite of generative media services for media creation and editing surfaced as Sogni Platform Tools. Sogni Platform Tools make the latest image, video, and music models available via Sogni's distributed GPU network for minimum cold-starts and maximum task concurrency. \
\
Sogni Intelligence can be accessed through the [Sogni Node / JavaScript Client SDK](https://www.npmjs.com/package/@sogni-ai/sogni-client?activeTab=readme) or through the \`/chat/completions\` REST API by both humans and [agents](https://api.sogni.ai/docs/llm-api.md).

Because Sogni Intelligence follows the OpenAI Chat Completions API format, any application or tool that supports a custom OpenAI-compatible endpoint can use the [Sogni Supernet](https://www.sogni.ai/supernet) as a distributed backend. Just change the **base URL** and **API key** — everything else stays the same.\
\
From prompt-expansion to media analysis to agentic multi-tool, multi-turn generative content creation, you can see Sogni Intelligence in action in Sogni SuperApps including [Sogni Chat](https://chat.sogni.ai), [Sogni 360](https://360.sogni.ai), [Sogni Makeover](https://makeover.sogni.ai), [Sogni Image Restore](http://restore.sogni.ai/), [Sogni Photobooth](https://photobooth.sogni.ai), and [Sogni Create](https://app.sogni.ai).

***

### OpenAI API Compatibility

Sogni Intelligence implements the following OpenAI-compatible endpoints:

| Endpoint               | Method | Description                                            |
| ---------------------- | ------ | ------------------------------------------------------ |
| `/v1/chat/completions` | POST   | Create a chat completion (streaming and non-streaming) |
| `/v1/models`           | GET    | List available models                                  |
| `/v1/models/:model_id` | GET    | Get details for a specific model                       |

You can use these endpoints with the **OpenAI Python SDK**, the **OpenAI Node.js SDK**, **curl**, or any OpenAI-compatible client.

***

### Base URL

{% hint style="info" %}
**Base URL:** `https://api.sogni.ai`

All API requests go to `https://api.sogni.ai/v1/...`
{% endhint %}

***

### Available Models

| Model ID                                | Display Name                 | Context Window | Notes                                                        |
| --------------------------------------- | ---------------------------- | -------------- | ------------------------------------------------------------ |
| `qwen3.6-35b-a3b-gguf-iq4xs`            | Qwen 3.6 35B-A3B             | 262K tokens    | **Default model.** Qwen 3.6 with reasoning and tool calling. |
| `qwen3.5-35b-a3b-abliterated-gguf-q4km` | Qwen 3.5 35B-A3B Abliterated | 64K tokens     | Uncensored variant.                                          |

Use `GET /v1/models` to see the current list of available models at any time.

***

### Pricing

Sogni Intelligence usage is billed in **Spark** or **SOGNI** tokens — not USD.

|               | Rate                  |
| ------------- | --------------------- |
| Input tokens  | \~$0.30 per 1M tokens |
| Output tokens | \~$0.90 per 1M tokens |

You receive **free starter tokens** when you create an account, and you can claim a **daily bonus** in the app. See Supernet & Rewards for more details on acquiring tokens.

***

### Getting Your API Key

1. **Create a free account** at [app.sogni.ai](https://app.sogni.ai) if you haven't already.
2. **Open your Dashboard** — Go to [dashboard.sogni.ai](https://dashboard.sogni.ai) and log in. You'll land on the **Account & Wallet** tab.
3. **Go to the Developer section** — On the right-hand side of the dashboard, locate the **Developer** section and click **API Key**.
4. **Copy your API key** — A dialog will appear showing your API key (masked by default). Use the **eye icon** to reveal the full key, or the **copy icon** to copy it to your clipboard.

{% hint style="warning" %}
You can **Regenerate** your API key if it has been compromised, or **Disable** it if you no longer need access. Regenerating will invalidate your previous key — make sure to update it in all your applications.
{% endhint %}

Your API key can also be used with the **Sogni SDK** or to run a **Sogni Fast Worker**.

Include the key as a Bearer token in all requests:

```
Authorization: Bearer YOUR_API_KEY
```

{% hint style="info" %}
Make sure your account has sufficient **SOGNI** or **Spark Point** balance before making API calls. You can check your balance on the **Account & Wallet** tab and top up by purchasing SOGNI tokens directly from the dashboard.
{% endhint %}

***

### API Reference Documentation for Agentic Agents

For the complete Sogni LLM API reference, see: <https://api.sogni.ai/docs/llm-api.md>

***

### Quick Test

Verify your API key works with a simple curl request:

```bash
curl https://api.sogni.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "qwen3.6-35b-a3b-gguf-iq4xs",
    "messages": [
      {"role": "user", "content": "Hello! What model are you?"}
    ]
  }'
```

You should receive a JSON response with the model's reply in `choices[0].message.content`.

***

#### Supported top-level fields

* model: model ID to use
* messages: conversation history
* stream: set true for SSE streaming of result tokens in real-time instead of a single response payload.
* max\_tokens: max output tokens
* temperature, top\_p, frequency\_penalty, presence\_penalty, stop: standard OpenAI-style sampling controls
* tools, tool\_choice: custom tools/function calling
* sogni\_tools: set false to disable auto-injected Sogni media tools
* sogni\_tool\_execution: set false to disable automatic Sogni tool execution
* task\_profile: optional preset hint, one of `general`, `coding`, or `reasoning`. This can be used to automagically set all inference properties like `top_p` and `frequency_penalty` to optimized presets for your task. &#x20;
* chat\_template\_kwargs: optional backend-specific chat template settings such as turning thinking mode off or on: {"enable\_thinking": false}
* token\_type: billing token preference, one of `auto`, `spark`, or `sogni`

***

### Sogni Tools

Sogni chat completions can act as a media-generation agent, not just a text model.

By default, `POST /v1/chat/completions` automatically injects six built-in Sogni tools so the model can decide when to generate media:

* `sogni_generate_image`: text-to-image generation
* `sogni_edit_image`: image editing, likeness preservation, and multi-reference image generation
* `sogni_generate_video`: text-to-video and image-to-video generation
* `sogni_sound_to_video`: audio-driven video, music-video, and lip-sync style generation
* `sogni_video_to_video`: restyling or transforming an existing video
* `sogni_generate_music`: songs, beats, ambience, and instrumental music generation

These tools let the model generate structured tool\_calls for Sogni media workflows.

If you want plain text only, disable tool injection set `sogni_tools` to false.

Example: automatic image generation

```bash
curl https://api.sogni.ai/v1/chat/completions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -d '{
      "model": "qwen3.6-35b-a3b-gguf-iq4xs",
      "messages": [
        {
          "role": "user",
          "content": "Generate a cinematic image of a neon-lit alley in Tokyo during rain."
        }
      ]
    }'
```

You should receive a JSON response with the model's reply in `choices[0].message.content`.

***

#### Developer role support

The API accepts developer messages for compatibility with agentic coding tools such as Codex, OpenCode, and similar clients. If you send a developer message and do not set `task_profile`, the API defaults it to `coding`.

Example:

```bash
curl https://api.sogni.ai/v1/chat/completions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -d '{
      "model": "qwen3.6-35b-a3b-gguf-iq4xs",
      "messages": [
        {
          "role": "developer",
          "content": "You are a careful coding assistant. Explain changes before making risky suggestions."
        },
        {
          "role": "user",
          "content": "Write a React hook called useDebouncedValue in TypeScript."
        }
      ]
    }'
```

You should receive a JSON response with the model's reply in `choices[0].message.content`.

***

### What's Next

* **Open WebUI Integration** — Connect Sogni Intelligence to Open WebUI
* **OpenClaw Integration** — Use Sogni Intelligence as a provider in OpenClaw


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sogni.gitbook.io/sogni-docs/sogni-intelligence/introduction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
