Source: https://docs.sogni.ai/sogni-intelligence/integration-open-webui/

# 🌎Open WebUI Integration

[Open WebUI](https://openwebui.com/) can connect to Sogni Intelligence through its OpenAI-compatible provider support. This gives self-hosted Open WebUI users access to Sogni's LLMs, streaming chat, vision-capable models, and server-side Sogni media tools.

## [#](https://docs.sogni.ai/sogni-intelligence/integration-open-webui/#prerequisites)Prerequisites

-   Open WebUI installed and running.
-   A Sogni API key from [dashboard.sogni.ai/api-key](https://dashboard.sogni.ai/api-key).
-   A Sogni account with Spark or SOGNI token balance.

## [#](https://docs.sogni.ai/sogni-intelligence/integration-open-webui/#add-sogni-as-an-openai-compatible-connection)Add Sogni As An OpenAI-Compatible Connection

1.  Open Open WebUI.
2.  Go to **Admin Settings**.
3.  Open **Connections**.
4.  In the OpenAI-compatible connection area, choose **OpenAI** and add a new external connection.
5.  Enter:

| Field | Value |
| --- | --- |
| URL | `https://api.sogni.ai/v1` |
| API Key | Your Sogni API key |

Save the connection, then return to chat and open the model selector.

## [#](https://docs.sogni.ai/sogni-intelligence/integration-open-webui/#model-ids)Model IDs

Use `GET https://api.sogni.ai/v1/models` for the live model list. Current public model IDs include:

-   `qwen3.6-35b-a3b-gguf-iq4xs`
-   `qwen3.5-35b-a3b-abliterated-gguf-q4km`

## [#](https://docs.sogni.ai/sogni-intelligence/integration-open-webui/#using-sogni-tools-from-open-webui)Using Sogni Tools From Open WebUI

Sogni injects media tools by default. If you ask Open WebUI to create an image, video, or music track, `/v1/chat/completions` can execute the Sogni tool server-side and return Markdown links in the assistant response.

Example prompts:

-   `Generate a cinematic image of a neon alley in Tokyo during rain.`
-   `Create a five second video of ocean waves crashing on black rocks at sunset.`
-   `Compose a 30 second upbeat synthwave instrumental.`

For plain chat or coding-only use, disable Sogni tools if your Open WebUI deployment exposes per-provider request body overrides:

```
{
  "sogni_tools": false
}
```

If no such override is available, the default tool list is safe to leave enabled; the model only calls a media tool when the request calls for one.

## [#](https://docs.sogni.ai/sogni-intelligence/integration-open-webui/#cost-control)Cost Control

Sogni media tools spend tokens. A few rules worth surfacing in your Open WebUI setup:

-   **Pick the billing token.** Send `token_type: "spark"` (purchased) or `token_type: "sogni"` (native) via Open WebUI's per-provider request body override if available. Defaults to `auto`.
-   **Vendor models need explicit naming.** OpenAI GPT Image 2, [ByteDance Seedance 2.0](https://www.sogni.ai/models/seedance-2-0) / Fast / Mini, and [Alibaba HappyHorse 1.1](https://www.sogni.ai/models/happyhorse-1-1) require Premium Spark and are never picked by the router on your behalf — your prompt or extra-body needs to name them.
-   **For durable progress / cost approval**, use the `/v1/chat/runs` endpoint with `confirm_cost: true` and `max_estimated_capacity_units` directly from your code; Open WebUI itself talks to the synchronous `/v1/chat/completions` endpoint.

See [Billing & Cost Control](https://docs.sogni.ai/sogni-intelligence/billing-and-cost-control/) for the full token-type, gating, and approval flow.

## [#](https://docs.sogni.ai/sogni-intelligence/integration-open-webui/#vision-notes)Vision Notes

Sogni vision input follows the OpenAI content-parts format and requires inline base64 PNG or JPEG `data:` URIs. Open WebUI image upload behavior can vary by version and deployment. If an image-analysis request fails, confirm the request body sent by Open WebUI uses `image_url.url: "data:image/..."` rather than a private or remote file URL.

## [#](https://docs.sogni.ai/sogni-intelligence/integration-open-webui/#troubleshooting)Troubleshooting

| Issue | Fix |
| --- | --- |
| Models do not appear | Confirm the URL is exactly `https://api.sogni.ai/v1`, including `/v1`, and verify the API key. |
| `401 authentication_error` | Regenerate or re-enable the API key in the Sogni dashboard. |
| `402 insufficient_quota` | Add Spark or SOGNI token balance, or claim any available account bonus. |
| Media request returns text only | Make sure `sogni_tools` is not set to `false`; ask explicitly for an image, video, or music output. |
| Vision request fails | Check whether Open WebUI is sending inline base64 image data. |

Open WebUI's provider setup may move between versions; see the [Open WebUI OpenAI-compatible provider guide](https://docs.openwebui.com/getting-started/quick-start/connect-a-provider/starting-with-openai-compatible/) for the current UI path.
