AI Features

AI Configuration (BYOK)

By default, your app uses Webase's shared AI infrastructure. With Bring Your Own Keys (BYOK), you can connect your own OpenAI or Anthropic API keys, choose your preferred models, and control exactly how AI runs in your app.

Why use your own keys? BYOK gives you direct control over costs, access to the latest models as soon as they're released, higher rate limits from your own API accounts, and the ability to use your organization's existing API agreements.

Adding Your OpenAI API Key

1

Get Your API Key

Log in to your OpenAI account at platform.openai.com. Navigate to API Keys in the settings and create a new secret key. Copy it immediately — OpenAI only shows the full key once.

2

Add It to Your App

In the Application Editor, open your app's AI Configuration settings. Paste your OpenAI API key into the designated field. Webase encrypts and stores your key securely — it is never exposed in your app's frontend code.

Adding Your Anthropic API Key

1

Get Your API Key

Log in to your Anthropic account at console.anthropic.com. Navigate to API Keys and generate a new key. Copy it before closing the dialog.

2

Add It to Your App

Paste your Anthropic API key into the Anthropic key field in your app's AI Configuration settings. Like OpenAI keys, it is encrypted and stored securely.

Selecting a Default Model

Once you've added at least one API key, you can choose a default model for your app. The default model is used whenever your app makes an AI request without specifying a particular model. Options include:

  • OpenAI models: GPT-4o, GPT-4o Mini, and other available models.
  • Anthropic models: Claude Sonnet, Claude Haiku, and other available models.

Setting Rate Limits

You can configure rate limits to control how often your app calls the AI API:

  • RPM (Requests Per Minute) — The maximum number of AI requests your app can make in a single minute. Helps prevent runaway costs from bugs or abuse.
  • RPD (Requests Per Day) — The maximum number of AI requests per day. Provides a daily safety net for spending control.

Tip: Start with conservative rate limits (e.g., 30 RPM, 500 RPD) and increase them as you understand your app's usage patterns. It's easier to raise limits than to deal with an unexpected bill.

Configuring Max Tokens Per Request

Max tokens controls the maximum length of each AI response. A higher value allows longer, more detailed responses but costs more per request. A lower value keeps responses concise and costs down. For reference, 100 tokens is roughly 75 words. A max of 500 tokens works well for short answers, while 2000-4000 tokens is better for detailed content generation.

Custom System Prompts

A system prompt guides the AI's behavior for every request in your app. You can set a custom system prompt to:

  • Define the AI's personality — "You are a friendly cooking assistant who gives concise recipe suggestions."
  • Set boundaries — "Only answer questions related to fitness and nutrition. Politely decline other topics."
  • Format responses — "Always respond in bullet points. Keep answers under 3 sentences."
  • Provide context — "You are the support assistant for Acme Corp. Our products include widgets, gadgets, and sprockets."

Payment Mode

BYOK supports two payment modes:

  • Owner pays — All AI costs are billed to your API account. End-users don't pay anything. This is the default.
  • User pays — End-users provide their own API keys. Useful for developer tools where each user controls their own spending.

Security note: Your API keys are encrypted at rest and never exposed to your app's frontend code or end-users. All AI requests are proxied through Webase's backend, which adds your key server-side.

Next Steps