Getting an API key for your AI provider
How to create an API key and set up billing with OpenAI, Claude or Gemini, for use on the LangLime BYOK plan.
OpenAI
-
First, you’ll need to create an OpenAI account, if you don’t already have one.
-
Once you have an account, head to the API keys page of the OpenAI platform and click on the green button that says “Create new secret key”.
-
You’ll be greeted with a popup that looks something like this:
Creating an OpenAI API key -
You can leave most of the settings as default, but just be sure to create a name for the key. Copy this key and store it somewhere safe.
-
Here comes the fun part... paying. Click on your profile icon in the top right of the screen, and head to “Your profile”. From here, you can then click on the “Billing” tab in the left bar. Or just follow this link.
-
From here, click on that scary “Add payment details” button and fill out the form.
So. Now you have a funded OpenAI account and a working API key. You can come back to this platform when you need to top up your credits, or check your usage stats.
Claude
-
You’ll have to sign up to the Claude platform if you haven’t yet got an account, and complete the welcome flow.
-
These guys aren’t messing around. They want you to enter your card details straight away. Hmmmm... let’s humour them. Click on the “Buy credits” button and fill out the form.
-
Once you’re through this paywall, you can finally get to the API keys page by following this link, or by clicking on the key icon in the left bar.
-
Click on the button that says “Create Key”, and give your new friend a name:
Creating a Claude API key -
Keep hold of this key, and you’re all ready to go :)
Like with OpenAI, the Claude platform lets you top up your credits and check out your usage.
Gemini
-
I’m sure you’ve got a Google account already, so just go ahead and log in to Google’s AI Studio.
-
Click on the button near the top of the screen that says “Get API key”, which will take you to the API key page... obviously.
-
This page has another button, this time saying “Create API key”. If you’ve ever used Google’s Cloud Platform, you can assign your key to a certain project, or you can just leave it blank. Copy that bad boy, and now it’s time to worry about billing.
-
On this same page, near the bottom, you should see your new key appear. Clicking on the link (shown with the red arrow) will take you to the billing page.
Gemini billing link -
Follow the instructions to fund your API key, and voila. Like the other two AI providers, you can view your usage on this page.
