SETUP GUIDES · AI MODELS

OpenAI API key

Let Claspine call OpenAI models (like GPT) using your own OpenAI account.

⏱ About 5 minutes

Claspine does not resell AI. When your app asks Claspine for an AI answer, Claspine calls the AI provider with your key, so you pay OpenAI directly and keep full control. This guide creates a key that is used only by Claspine and has a spending cap.

Words you’ll see

API key
A long secret string that lets software use your account, like a password made for programs. Anyone who has it can spend on your account, so treat it like a password.
Project (at the provider)
A folder inside your provider account that groups keys, usage and limits. Using a separate one for Claspine keeps its spending and keys apart from everything else.
Spending limit / budget
A cap or alert you set at the provider so a mistake or abuse cannot run up an unexpected bill.
Model
The specific AI you call (for example a fast, cheap one or a larger, smarter one). Claspine’s AI Gateway lets you choose models and fall back to another if one fails.
AI Gateway route
A list of models Claspine tries in order for a given kind of request. If the first fails, Claspine moves to the next.

Before you start

  • An OpenAI Platform account at platform.openai.com with a payment method added (Settings → Billing). A ChatGPT subscription is separate and does not include API usage.

Steps

  1. Sign in at platform.openai.com.
  2. Create a project just for Claspine: click the project name at the top left, then Create project, and name it something like “Claspine”.
  3. With that project selected, open Settings → Limits and set a monthly budget you are comfortable with.
  4. Open API keys and click Create new secret key. Give it a name such as “Claspine production” and keep it owned by the project.
  5. Copy the key now. It starts with sk-, and OpenAI shows it only once. If you lose it, simply create a new one.
  6. Open the Claspine console, choose your project and go to AI Gateway.
  7. Under 1. Your AI provider keys, find OpenAI (click Show all if you don’t see it) and click Add key. (The Secret Vault lists the same keys under AI Models.)
  8. Paste the values from the steps above and click Save key. Claspine encrypts them straight away and will only ever show the last few characters again.
  9. Under 2. Your AI route, choose this provider and pick a model, then save. The list comes live from your account, so you only see models you can use.
  10. Send a test request from your app. The usage appears on your bill at the provider, not on Claspine’s.

What goes where in Claspine

Console fieldValue
API KEYThe secret key you copied (starts with sk-).

Keep it safe

  • Keep the budget from step 3: it is your safety net if something goes wrong.
  • Use separate keys for testing and for your live app, so you can switch one off without affecting the other.
  • If you think a key was exposed, delete it in OpenAI’s API keys page, create a new one and replace it in Claspine.

Claspine stores the values encrypted, never shows them again in full, and never sends them to your app or SDK.

If something goes wrong

The model list in AI Gateway is empty or the test fails with “insufficient quota”.
Add a payment method or credits under Settings → Billing in OpenAI, then try again.
Error saying the key is invalid.
Check you copied the whole key without spaces, and that it belongs to the project you expect.

← All setup guides