Checked 2026-11-03

Agnai (Agnaistic) setup: the Third-Party API fields

Point an Agnai preset at RelaySwitch: five fields, the model id to type, and what each message costs.

Agnai reaches a hosted API through a preset whose AI Service is Third-Party. Set the format to OpenAI Compat (Chat), paste https://api.relayswitch.io/v1 as the Third Party URL, the key in Third Party Key/Password, and a model id in OpenAI Model Override. One key reaches every model in the catalog, from the uncensored roleplay builds to Claude, billed per token from a prepaid balance. The same preset works on agnai.chat and on a self-hosted copy.

01What you need

  • An Agnai account on agnai.chat, or your own instance from the repository.
  • A RelaySwitch key from the console (email code sign-in). Keys start with sk-relay-.
  • A balance. Top-ups start at $10, by card or crypto, with no subscription. Before the first top-up the console chat runs 12 free turns a day, so you can try a model there before you connect it.

02The preset fields

Open Presets, create one (or edit the one your chat uses), and set these, in this order:

text
1AI Service: Third-Party
2Third Party Format: OpenAI Compat (Chat)
3Third Party URL: https://api.relayswitch.io/v1
4Third Party Key/Password: sk-relay-...
5OpenAI Model Override: glm-5.3-uncensored
  1. AI Service: Third-Party. Agnai's own services send to its models; Third-Party is the one that takes a URL.
  2. Third Party Format: OpenAI Compat (Chat). The list also offers OpenAI Compat (Chat - Legacy), OpenAI (Completion), Kobold, Llama.cpp and others; each sends a different request shape, and only the chat format matches this API.
  3. Third Party URL: https://api.relayswitch.io/v1, with the /v1 and nothing after it. Agnai appends the chat completions path.
  4. Third Party Key/Password: your sk-relay- key, nothing in front of it.
  5. OpenAI Model Override: the exact id from the Models page. Agnai sends that value as the model name; a display name answers 404 model_not_found.

Save the preset and attach it to the chat. Agnai has no test button: the first message is the test, and an error shows in place of the reply with its status code.

03Which model to type

Uncensored and roleplay builds first: they answer without the stock refusals, and the roleplay ones are tuned on fiction and dialogue. Prices are per million tokens. The turn columns price one 2K-in / 300-out turn: 2,000 tokens of card, persona and recent history in, 300 tokens of reply out.

ModelOpenAI Model OverrideContextInput / MOutput / Mone 2K-in / 300-out turn100 turns
GLM-5.3 Flash Uncensoredglm-5.3-flash-uncensorednot stated$0.1053$0.3685$0.00032$0.0321
GLM-5.3 Uncensoredglm-5.3-uncensorednot stated$0.282$0.846$0.00082$0.0818
Gemma 4 31B Fabledgemma-4-31b-fabled262K tokens$0.35$1.575$0.0012$0.1173
Qwen3.8 27B Novelistqwen3.8-27b-novelist262K tokens$0.35$2.10$0.0013$0.133
Cydonia 24B v4.3cydonia-24b-v4.3131K tokens$0.484$0.60$0.0011$0.1148
Uncensored AI Roleplayuncensored-ai-roleplay128K tokens$0.60$2.34$0.0019$0.1902
DeepSeek V4.1 Flash Abliterateddeepseek-v4.1-flash-abliteratednot stated$0.8488$1.6975$0.0022$0.2207
DeepSeek V4 Pro Uncensoreddeepseek-v4-pro-uncensorednot stated$0.97$1.94$0.0025$0.2522

USD, read from the RelaySwitch catalog when this page was built.

The flagships, for longer memory and stronger writing:

ModelOpenAI Model OverrideContextInput / MOutput / Mone 2K-in / 300-out turn100 turns
Claude Sonnet 4.6claude-sonnet-4-61M tokens$1.80$9.00$0.0063$0.63
Gemini 3.1 Pro Previewgemini-3.1-pro-preview1M tokens$1.20$7.20$0.0046$0.456
DeepSeek V3.2deepseek-v3.2not stated$1.08$1.6801$0.0027$0.2664
Grok 4.6grok-4.6500K tokens$0.60$1.80$0.0017$0.174
GLM 5.3glm-5.31M tokens$0.3178$0.9987$0.00094$0.0935

USD, read from the RelaySwitch catalog when this page was built.

The uncensored models page lists every build the catalog tags, and the ranked list orders them by use.

04What a long chat costs

Every message resends the card, the memory book entries and as much history as the preset's context limit allows, so input grows as the chat does. Per message at three context sizes, with a 300-token reply:

Context sentGemma 4 31B FabledGLM-5.3 UncensoredClaude Sonnet 4.6
4,000 tokens$0.0019$0.0014$0.0099
8,000 tokens$0.0033$0.0025$0.0171
16,000 tokens$0.0061$0.0048$0.0315

USD per message, read from the RelaySwitch catalog when this page was built.

Keep the preset's context limit at or under the model's window in the Context column. The console's Usage page lists every request with its tokens and charge, and each one has a signed receipt.

05Errors

  • 401 "No API key was sent" or invalid_api_key: Third Party Key/Password is empty or wrong. Paste the key again.
  • 402: the balance is empty, or the key reached its own budget. Top up or raise the budget in the console.
  • 404 model_not_found: the id in OpenAI Model Override is not in the catalog. Copy it from the Models page. route_not_found: the URL is wrong or the format is not OpenAI Compat (Chat).
  • 429: the key hit its requests or tokens per minute limit. Wait a few seconds and resend.
  • 503: no host could serve that model right now. Resend, or pick another model.

06Sources

The service, format and field names are from Agnai's source, common/adapters.ts on the dev branch, read 2026-11-03. The in-app click path is not asserted beyond the Presets panel; match each field by its label.

Questions

Does Agnai support a custom OpenAI-compatible API?
Yes, through the Third-Party AI Service: Third Party Format OpenAI Compat (Chat), the URL https://api.relayswitch.io/v1, the key in Third Party Key/Password and the model id in OpenAI Model Override.
Where is the model field in Agnai?
It is called OpenAI Model Override, in the same preset as the URL and key. Type the id exactly as the Models page prints it; Agnai does not fetch a model list.
Is Agnai free?
agnai.chat is free to use with its own models, and the code is open on GitHub. A Third-Party connection is billed by the API behind it: here per token, prepaid from $10, no subscription.
How much does an Agnai message cost?
One 2K-in / 300-out turn on GLM-5.3 Flash Uncensored costs $0.00032 today, or $0.0321 for 100. A larger context limit raises the input side once the chat fills it.
Which Third Party Format do I pick?
OpenAI Compat (Chat). The Legacy, Completion and Kobold options send a different request shape and answer 404 route_not_found here.

Every model in one Agnai preset

Prepaid from $10 by card or crypto. No KYC, no subscription.

Join on Telegram