# Connect Agnai to Unrestricted AI

Use Unrestricted AI in an Agnai preset: AI Service Third-Party, the OpenAI Compat (Chat) format, our base URL and your key.

## What you need

An Unrestricted AI API key from https://tryunrestrictedai.com/api/console#keys, plus these values. Agnai works with any OpenAI-compatible chat completions endpoint; this is not an official Agnai integration.



| Setting | Value |
| --- | --- |
| URL | https://tryunrestrictedai.com/v1 |
| Model | venice-uncensored-1-2 |
| API key | Your key from the console (starts with ua_) |

## Set up Agnai



- 1. Open Presets and create a new preset In Agnai the connection lives inside a generation preset.
- 2. Set AI Service to “Third-Party”
- 3. Set Third-Party Format to “OpenAI Compat (Chat)”
- 4. Paste the base URL into “URL”: https://tryunrestrictedai.com/v1 Agnai adds /chat/completions itself. Leave “Disable Auto-URL” off.
- 5. Paste your key into the Third Party Key/Password field
- 6. Enter the model ID as a “Manual Model ID”: venice-uncensored-1-2
- 7. Save the preset and use it Make it your default preset, or select it from the chat’s preset menu. An older preset left on a chat keeps sending there.


## Recommended settings

Model output limit: 4,096 tokens. Context window: 32,768 tokens.

- Keep “Response Length” at or below the output limit above.
- Leave “Use Local Requests” off so Agnai’s server sends the request.


## Troubleshooting





| Status | Code | Fix |
| --- | --- | --- |
| 401 | invalid_api_key | The key is missing, mistyped or revoked. Paste the whole key (it starts with ua_) without “Bearer”, or create a new key in the console. |
| 402 | insufficient_credit · key_budget_exceeded · plan_limit | No usage left. Choose a plan or add credit in Billing, create a key with a higher spending limit, or lower the max response length. |
| 429 | rate_limit | More than 30 requests a minute or 3 at once. Turn off multiple swipes, auto-continue and parallel generations, then wait a minute. |
| 503 | inference_unavailable | The model is not accepting requests right now, or the model ID does not match a live model. Check the model ID and the status page, then retry. |
| 400 / 413 | unknown_model · invalid_request · context_limit | Wrong model ID, a response length above the output limit, or a context that is too long. Copy the model ID again and lower context or response size. |

## Limits and terms

Text chat with streaming is supported. Usage is billed per token from your plan allowance or credit, and each key has its own lifetime spending limit. Our terms and the selected model provider’s terms apply to role-play use the same as any other use: you must be 18 or older and the content must be lawful.




## Sources

- [Agnai source: Third-Party preset settings](https://github.com/agnaistic/agnai)

Canonical: https://tryunrestrictedai.com/api/integrations/agnai
