#
Chat Completions
#
Source-specific instructions
Important!
Most API platforms allow you to view the generated API key only once, at the time of its creation. If you lose it, you will need to generate a new key. Make sure to keep it safe!
#
OpenAI
Use OpenAI's developer platform to access various OpenAI models, including gpt-4o, gpt-4.1, o3, etc.
How to get an API key:
- Go to OpenAI and sign in.
- Use "View API keys" option to create a new API key.
#
Claude
Claude is a family of AI models developed by Anthropic. You can access Claude models through the Anthropic console.
How to get an API key:
- Go to Anthropic Console and sign in.
- Use the "Get API Key" section to create a new API key.
#
Mistral AI
Mistral AI is a team developing both open and proprietary models with high scientific standards and a focus on openness. You can run their models locally or through their API service, La Plateforme.
How to get an API key:
- The first step is to create an account on La Plateforme.
- Once that's done, you can choose a plan and set up your payment information or opt for the Free Tier.
- Next, you can create your API key. You may need to wait a couple of minutes before the key becomes valid!
#
DeepSeek
DeepSeek Platform provides access to the latest DeepSeek models through an API. They offer a range of models, including DeepSeek V3 and DeepSeek R1.
How to get an API key:
- Sign up on the DeepSeek Platform.
- After signing up and topping up your account, you can create an API key in the "API keys" section.
#
AI21
AI21 Labs offers a range of AI models, including their flagship Jamba series. You can access their models through the AI21 Studio API.
How to get an API key:
- Go to AI21 Studio and sign in.
- Navigate to the "Settings => API Keys" section to create a new API key.
#
Cohere
Cohere provides a suite of AI models for various tasks, including text generation and embeddings. You can access their models through the Cohere API.
How to get an API key:
- Go to Cohere and sign in.
- Navigate to the "API Keys" section in your account settings to create a new API key.
#
Perplexity
Perplexity AI offers access to online-enabled Sonar models through their API for real-time research and information retrieval.
Official Getting Started guide: Perplexity Quickstart
How to get an API key:
- Go to Perplexity and sign in.
- Go to the "API billing" section to purchase credits for API usage.
- Navigate to the "API keys" section in the settings to create a new API key.
#
Fireworks AI
Fireworks AI is a high-performance platform that provides fast, cost-effective access to state-of-the-art open-source language models. The platform offers serverless deployment with OpenAI-compatible APIs and supports context windows up to 256,000 tokens.
How to get an API key:
- Go to Fireworks AI and create an account or sign in.
- Navigate to the API Keys page in your account settings.
- Click "Create API key" and provide a descriptive name (e.g., "SillyTavern").
#
Electron Hub
Electron Hub is a unified OpenAI-compatible platform that provides access to models from multiple vendors through a single API key.
How to get an API key:
- Create an account at Electron Hub.
- Generate an API key from the Console → API Keys page.
#
Custom OpenAI-compatible endpoint
It is important to note that we do not provide support for possible issues that you may have! We do not guarantee compatibility with every possible API endpoint!
If you intend to use this feature to use a local endpoint, like TabbyAPI, Oobabooga, Aphrodite, or any like those, you might want to check out the built-in compatibility for those instead. The custom endpoint feature is mainly intended for use with other services and programs that expose an OpenAI-compatible API Chat Completion endpoint.
Most Text Completion APIs support far greater customization options than OpenAI's standards allow for. These greater customization options, such as the Min-P sampler, may be worthwhile for SillyTavern users to check out, which can greatly improve the quality of generations.
You can configure an alternative endpoint for the Chat Completions backend. This custom endpoint can connect to any server that supports the generic OpenAI API schema.
Examples of compatible backends include:
#
Connecting
To access this feature:
- Switch to the 'Chat Completion' API type
- Select 'Custom (OpenAI-compatible)' for 'Chat Completion Source'
Enter the custom endpoint URL and an API key if required. For example, TabbyAPI requires an API key for authentication.
Hint: If you experience connection issues, try adding /v1 to the end of the endpoint URL. Do NOT add the /chat/completions suffix.
#
Selecting a Model
If the custom API implements the /v1/models endpoint to provide a list of available models, you can choose from a dropdown list. Otherwise, use the text field to manually input a model ID.
Check 'Bypass API status check' to prevent SillyTavern from alerting you about a non-functioning API endpoint. Enable this option if your API endpoint works properly but SillyTavern continues to display warnings.
Click "Test Message" to verify connectivity by sending a simple prompt to the model.
#
Prompt Post-Processing
Note: Tool Calling is not supported when Post-Processing option with "no tools" is used!
Some endpoints may impose specific restrictions on the format of incoming prompts, such as requiring only one system message or strictly alternating roles.
SillyTavern provides built-in prompt converters to help meet these requirements (from least to most restrictive):
- None - no explicit processing applied unless strictly required by the API
- Merge consecutive messages from the same role
- Semi-strict - merge roles and allow only one optional system message
- Strict - merge roles, allow only one optional system message, and require a user message to be first
- Single user message - merge all messages from all roles into a single user message
Merge, semi-strict, and strict additionally remove any tool calls from the prompt, unless the "with tools" variant is selected. This is useful for APIs that do not support tool calling and your existing prompts contain tool calls.
Less restrictive options have no effect on more restrictive endpoints implemented in SillyTavern other than "Custom OpenAI-compatible"; Custom may error upon invalid request.
In strict mode, if no user message exists before the first assistant message, then promptPlaceholder from config.yaml will be inserted, which by default is "[Start a new chat]".