# How to Buy OpenAI API Credits and Add a Payment Method

If you want to use OpenAI’s API in your own apps, bots, or systems, you’ll need to:\
&#x20;Add a payment method\
&#x20;Buy credits or enable pay-as-you-go billing\
&#x20;Generate an API key

Here’s a simple step-by-step guide:

#### &#x20;**1️ Log In to the OpenAI API Platform**

1. Go to [platform.openai.com/account](https://platform.openai.com/account)
2. Sign in with your OpenAI account (you can use the same account as your ChatGPT plan if you like).

***

#### &#x20;**2️Add a Payment Method**

1. Go to: [platform.openai.com/account/billing/payment-methods](https://platform.openai.com/account/billing/payment-methods)
2. Click **“Add payment method.”**
3. Enter your credit/debit card details and save.

***

#### &#x20;**3️ Enable Pay-As-You-Go or Buy Prepaid Credits**

**Option A — Pay-As-You-Go**

* Go to: [platform.openai.com/account/billing/overview](https://platform.openai.com/account/billing/overview)
* Enable **Pay-As-You-Go** billing.
* Set a monthly spending limit (optional but recommended to avoid surprises).

**Option B — Buy Prepaid Credits (Optional)**

* Go to: [platform.openai.com/account/billing/credit](https://platform.openai.com/account/billing/credit)
* Purchase credits in fixed amounts ($5, $10, $20, etc.).
* The cost of your API usage will be deducted from these prepaid credits instead of charging your card per use.

***

#### &#x20;**4️ Generate an API Key**

1. Go to: [platform.openai.com/api-keys](https://platform.openai.com/api-keys)
2. Click **“Create new secret key.”**
3. Copy and store the key securely — you’ll use it in your code to authenticate API calls.

***

#### **Important Notes**

* The ChatGPT Plus/Pro subscription does **NOT** include API credits — you must add a payment method and buy credits separately.
* New developers often get free credits (e.g., $5–$18) for a limited trial — check your account for eligibility.
* Monitor your usage to control costs: [platform.openai.com/account/usage](https://platform.openai.com/account/usage)

***

### **You’re Ready to Build!**

Once your payment method is added and your API key is ready, you can start calling OpenAI’s models in your own apps, scripts, or integrations.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.doubletick.io/ai-agent/how-to-buy-openai-api-credits-and-add-a-payment-method.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
