AI for Small Business
Aware · M26 · lesson 26 of 93 · queued
Preview — browse every lesson free. Enroll to mark lessons complete, open partner links and save your progress. Login & enroll →
📖
in this lesson

API Basics for Small Business Owners

10 min

The missing piece between knowing which integration platform to use and actually building workflows is understanding APIs. APIs are how software talks to software. When you connect your CRM to an email tool, or send a request to your AI tool to analyze text, you're using APIs.

You don't need to become a developer. But you do need to understand what API keys are, why they're secret, how rate limits work, and how to manage costs. This knowledge saves you money, prevents security disasters, and makes you dangerous with AI automation.

By the end of this lecture, you'll understand the mechanics that underpin every workflow you'll build. More importantly, you'll know how to use APIs safely and economically.

What Is an API, Really?

An API (Application Programming Interface) is a standardized way for software systems to communicate with each other. Instead of thinking of it as a technical concept, think of it as a restaurant.

When you go to a restaurant, you don't walk into the kitchen and grab food yourself. You give your order to a server. The server takes it to the kitchen. The kitchen prepares it. The server brings it back. You don't need to know how to cook. You don't need access to the kitchen. You just follow a protocol: you order, the restaurant delivers.

An API works exactly the same way. Your software (or Zapier, or Make) sends a request to another service's servers. The request says "I want you to do X with data Y." The remote service processes the request and sends back a response. You got what you asked for without needing to understand the internal machinery.

Here's what makes APIs powerful in a business context. Instead of manually entering data into every system your business uses, APIs let systems exchange data automatically. When a customer signs up on your website, an API can automatically add them to your CRM, send them an email, add them to a Slack channel, and log the action. All without human intervention.

The Restaurant Analogy

You = software making a request. The menu = the API documentation telling you what requests are possible. Your order = your specific request. The kitchen = the remote service processing your request. Your food = the response you get back. Never enter the kitchen. Always order through the server (the API). This separation of concerns is what makes APIs scalable and secure.

How AI APIs Work Specifically

AI APIs are a specialized type of API. They accept text input and return AI-generated output. When you use your AI tool through Zapier to analyze customer feedback, you're using your AI provider's API (whether that's OpenAI, Anthropic, Google, or another provider). The flow is:

1. Your Zapier workflow sends a request to your AI provider's API (whether that's OpenAI, Anthropic, Google, or another provider). The request includes: your API key (proof you're authorized), the text to analyze, and instructions (the system prompt).

2. the AI provider's servers receive the request and route it to an AI model. The model processes your text according to your instructions and generates a response.

3. The response is returned to Zapier with the AI-generated output. Zapier uses that output in the next step of your workflow.

What's critical to understand: each request is metered and costs money. your AI tool doesn't have a monthly subscription fee per user. It charges per usage. You pay for tokens consumed (text generated and analyzed). This is why managing API usage is critical in production workflows.

How to Get an AI API Key

To use an AI API, you need an API key. Here's how you get one, using OpenAI as an example:

  1. Go to your AI provider's developer portal (e.g., platform.openai.com, console.anthropic.com, or ai.google.dev)
  2. Sign up for an account
  3. Navigate to API keys section
  4. Create a new API key
  5. Copy the key and store it securely

Your API key is a secret credential. Treat it like a password to your bank account. If someone has it, they can make API requests on your behalf and you'll be charged for every single one.

API Key Security

Never share API keys in email, Slack, GitHub, documentation, or anywhere public. Never hardcode API keys in code you commit to version control. Store them in environment variables or secure secret management tools. If you accidentally expose an API key, revoke it immediately from your provider's dashboard. Set up alerts if possible so you're notified of unusual usage patterns that might indicate a compromised key.

Understanding Rate Limits

Every API has rate limits: caps on how many requests you can make in a given time period. Rate limits serve several purposes. They prevent abuse (a bad actor can't spam the API). They manage server load. They ensure fair access for all users. They protect you from runaway scripts that might hammer the API unintentionally.

Common Rate Limit Types

Requests per minute (RPM): The most common. "You can make 60 requests per minute." If you exceed this, your next requests are rejected until the minute resets.

Requests per day: Some APIs have daily caps. "You can make 100 API requests per day." Once you hit 100, you're blocked until midnight UTC.

Tokens per minute: AI APIs often rate-limit by tokens rather than requests. "You can send 90,000 tokens per minute." This is actually more flexible than request limits because a short request and a long request count differently.

Practical Impact of Rate Limits

If you have 1,000 customers and want to send an email with AI-generated personalization to each one, you can't do it instantly. You're rate-limited. You need to space out requests or batch them. Smart automation tools handle this automatically by queueing requests and respecting rate limits. Manual implementation requires you to build this logic yourself.

This is why understanding rate limits is essential before you scale a workflow. A workflow that works fine for 10 customers might break at 1,000 because you've hit rate limits.

Managing Rate Limits

Check your API provider's documentation for their specific limits. Zapier and Make handle many rate limits automatically. For custom implementations, add delays between requests or batch requests intelligently. Monitor your actual usage against limits. Set up alerts when approaching limits so you have time to adjust. Never assume rate limits will never be an issue—plan for scale from day one.

How API Pricing Works

This is where many businesses get surprised. API pricing models vary, but understanding them prevents budget disasters.

Token-Based Pricing (AI APIs)

AI APIs almost always use token-based pricing. A token is roughly 4 characters of text. An average word is about 1.3 tokens. Pricing varies by model:

Premium tier (e.g., OpenAI GPT-4, Claude Opus, Gemini Ultra): roughly $0.03 per 1,000 input tokens, $0.06 per 1,000 output tokens. A 1,000-token request and 500-token response costs about $0.06.

Efficient tier (e.g., OpenAI GPT-4o, Claude Sonnet, Gemini Pro): roughly $0.005 per 1,000 input tokens, $0.015 per 1,000 output tokens. Same request costs about $0.0125.

Mid-range models (e.g., Claude Sonnet, GPT-4o, Gemini Pro): roughly $0.003 per 1,000 input tokens, $0.015 per 1,000 output tokens.

The math gets serious fast. If you generate one 500-token output per customer and you have 100 customers per day, that's 50,000 tokens per day. At $0.015 per 1,000 output tokens, that's $0.75 per day or roughly $22.50 per month. Scale that to 1,000 customers and you're at $225/month. At 10,000 customers, you're at $2,250/month.

This is why efficiency matters. Using a cheaper model (a lighter model tier (like Claude Haiku, GPT-4o mini, or Gemini Flash) instead of a premium one) or shorter prompts (1,000 tokens instead of 2,000) directly impacts your budget.

Request-Based Pricing

Some APIs charge per request rather than per token. "Each API call costs $0.01." This model is simpler to predict but can be more expensive if your requests vary widely in complexity.

Subscription Pricing

Some APIs have tiered subscription models. "Pay $20/month for up to 1,000 API calls, $50/month for up to 10,000 calls." This model is good if your usage is predictable and within the tier limits. But it can become expensive quickly if you exceed the tier.

API Provider Pricing Model Typical Cost for 100 Requests Typical Cost for 10,000 Requests
Efficient (GPT-4o / Claude Sonnet / Gemini Pro) Per token ($0.005/$0.015) $0.50-2.00 $50-200
Mid-range (Claude Sonnet / GPT-4o / Gemini Pro) Per token ($0.003/$0.015) $0.30-1.50 $30-150
Light (Claude Haiku / GPT-4o mini / Gemini Flash) Per token ($0.00008/$0.0004) $0.01-0.05 $1-5
Google Gemini Per token ($0.0005/$0.0015) $0.05-0.15 $5-15

Cost Control Strategy

Use the cheapest model that meets your quality requirements. Haiku for classification tasks. Sonnet for complex reasoning. Only use a premium AI model (GPT-4, Claude Opus, or Gemini Ultra) when you really need it. Shorter prompts = lower costs. Batching requests can be more efficient than individual requests. Monitor usage daily. Set spending alerts with your API provider.

Public vs. Private APIs

Understanding the difference helps you know what's available to you as a small business.

Public APIs

Public APIs are available to anyone who signs up and gets an API key. OpenAI, Anthropic, Google, Stripe, Salesforce—all offer public APIs. These are the APIs you'll use in your integration platforms. Public APIs are well-documented, have good uptime guarantees, and have large communities.

Private APIs

Private APIs are only available to authorized partners or internal teams. They're not advertised publicly. Usually, you need a business relationship or explicit permission to access them. For example, a large enterprise customer might get a private API endpoint for deeper integration with a vendor.

As a small business, you'll focus on public APIs. They're the foundation of modern integration platforms and AI automation.

Real-World Workflow: Understanding the API Layer

Let's walk through what happens under the hood when you run a simple Zapier workflow that uses an AI API.

Trigger: Customer submits a contact form with a question.

Zapier Step 1 (Extract): Zapier receives the form data.

Zapier Step 2 (API Call to your AI tool): Zapier makes an API request to Anthropic. The request includes: your API key, the customer's question, and instructions to classify the question. the AI provider's servers process this and return a classification (billing question, product question, etc.).

Zapier Step 3 (Route based on classification): If billing, send to billing team. If product, send to product team.

Zapier Step 4 (API Call to Email): Zapier makes an API request to SendGrid (or another email service). This sends a confirmation email to the customer.

You're now using two public APIs: the AI provider's API and SendGrid's email API. Each has its own rate limits, pricing, and security requirements. Zapier handles the orchestration.

Key Takeaway

APIs are the plumbing of modern automation. Understanding what they are, how they work, what keys are needed, and how pricing works is the difference between sustainable automation and surprise bills. The integration platforms (Zapier, Make) abstract much of this complexity, but you need to understand the layer beneath them. This knowledge helps you design efficient workflows, manage costs, and troubleshoot problems when things break. Master APIs and you've mastered the technical foundation of AI automation.

What You'll Learn Next

Now that you understand integration platforms and APIs, you're ready to connect AI to your actual business systems. In , you'll learn specific patterns for integrating AI with the three systems that matter most for small business operations: your CRM, your email, and your calendar. We'll build real workflows you can implement this week.

Frequently Asked Questions

What exactly is an API?

An API (Application Programming Interface) is a protocol that lets software communicate with other software. You send a request with instructions and data. The API processes your request and sends back a response. Think of it like a restaurant: you order (request), the kitchen processes it, and you get food (response). The menu and ordering system are the API. APIs allow your software to automatically exchange data with other systems instead of requiring manual data entry.

What is an API key and why is it secret?

An API key is a unique credential that proves your identity and authorizes your access to an API. Think of it like a password to your API account. If someone has your API key, they can make requests on your behalf and you'll be charged for every request they make. Never share API keys in code you push to GitHub, email, or public documents. Store them securely in environment variables or secret management tools. If exposed, revoke the key immediately.

What are rate limits and why do APIs have them?

Rate limits are caps on how many requests you can make in a given time period (requests per minute, requests per day, tokens per minute, etc.). APIs enforce rate limits to prevent abuse, manage server load, and ensure fair access for all users. If you exceed the rate limit, your requests are rejected until the time window resets. Understanding your API's rate limits helps you design workflows that won't get blocked when scaled to real usage volumes.

How do AI API costs actually work?

AI APIs typically charge per token or per request. Tokens are chunks of text (roughly 4 characters). Different models cost different amounts per token. If you generate a 500-token output per customer and have 100 customers daily, that's 50,000 tokens daily. At $0.015 per 1,000 output tokens, that's $0.75/day or $22.50/month. The cost multiplies with scale. Use cheaper models when possible, keep prompts efficient, and monitor usage daily to control costs.

What's the difference between public APIs and private APIs?

Public APIs are available to anyone who signs up and gets an API key. OpenAI, Anthropic, Google, Stripe, Salesforce—all offer public APIs. Private APIs are only available to authorized partners or internal teams. For your small business, you'll work primarily with public APIs. They're well-documented, have good uptime, and have large communities. Public APIs are the foundation of modern integration platforms like Zapier and Make.