Loading lesson…
Going beyond the chat window. When you'd reach for the API, how pricing actually works, and how to start building. The API is where AI becomes a building block The consumer app is the most polished version of an AI experience.
The consumer app is the most polished version of an AI experience. The API is the same model, stripped of the UI, sold by the token. If you want to embed AI into a workflow, a product, or an automation — the API is how.
| Provider | Model | Input $/1M tokens | Output $/1M tokens |
|---|---|---|---|
| Anthropic | Claude Opus 4.x | ~$15 | ~$75 |
| Anthropic | Claude Sonnet 4.x | ~$3 | ~$15 |
| Anthropic | Claude Haiku 4.x | ~$0.80 | ~$4 |
| OpenAI | GPT-5 | ~$2.50 | ~$10 |
| OpenAI | GPT-5.4 Pro | ~$15 | ~$60 |
| Gemini 3 Pro | ~$1.25-$4 | ~$5-$15 | |
| Gemini 3 Flash-Lite | ~$0.10 | ~$0.40 | |
| xAI | Grok 4 | ~$3 | ~$15 |
import anthropic
client = anthropic.Anthropic() # Reads ANTHROPIC_API_KEY env var
message = client.messages.create(
model="claude-sonnet-4-5",
max_tokens=1024,
system="You are a terse, accurate research assistant.",
messages=[
{"role": "user", "content": "Give me three examples of convergent evolution in plants."}
],
)
print(message.content[0].text)
# Cost: input ~30 tokens, output ~200 tokens
# @ Sonnet pricing: ~$0.003 totalOne API call, one response, one very small bill. This is the atomic unit that subscriptions are built on top of.from openai import OpenAI
client = OpenAI() # Reads OPENAI_API_KEY
resp = client.responses.create(
model="gpt-5",
instructions="You are a terse, accurate research assistant.",
input="Give me three examples of convergent evolution in plants.",
)
print(resp.output_text)OpenAI's Responses API. Nearly identical shape to Anthropic's — intentional.from google import genai
client = genai.Client() # Reads GEMINI_API_KEY
response = client.models.generate_content(
model="gemini-3-pro",
contents="Give me three examples of convergent evolution in plants.",
config={"system_instruction": "You are a terse, accurate research assistant."},
)
print(response.text)Gemini's SDK converged on the same basic shape. Three SDKs, three identical mental models.The API is where you stop being an AI user and start being an AI builder.
— Every dev who shipped their first LLM app
The big idea: the consumer app is where you use AI. The API is where you make things with AI. Every lab exposes the same model both ways. Learning the API side is the jump from power user to creator.
15 questions · take it digitally for instant feedback at tendril.neural-forge.io/learn/quiz/end-tools-api-vs-consumer-creators
What is the core idea behind "API Access vs. Consumer Products — A Deeper Look"?
Which term best describes a foundational idea in "API Access vs. Consumer Products — A Deeper Look"?
A learner studying API Access vs. Consumer Products — A Deeper Look would need to understand which concept?
Which of these is directly relevant to API Access vs. Consumer Products — A Deeper Look?
Which of the following is a key point about API Access vs. Consumer Products — A Deeper Look?
Which of these does NOT belong in a discussion of API Access vs. Consumer Products — A Deeper Look?
Which statement is accurate regarding API Access vs. Consumer Products — A Deeper Look?
Which of these does NOT belong in a discussion of API Access vs. Consumer Products — A Deeper Look?
What is the key insight about "Input vs output pricing" in the context of API Access vs. Consumer Products — A Deeper Look?
What is the recommended tip about "Evaluate systematically" in the context of API Access vs. Consumer Products — A Deeper Look?
What is the key insight about "Security basics for API keys" in the context of API Access vs. Consumer Products — A Deeper Look?
Which statement accurately describes an aspect of API Access vs. Consumer Products — A Deeper Look?
What does working with API Access vs. Consumer Products — A Deeper Look typically involve?
Which best describes the scope of "API Access vs. Consumer Products — A Deeper Look"?
Which section heading best belongs in a lesson about API Access vs. Consumer Products — A Deeper Look?