Skip to content

API

Platforms: claude openai gemini m365-copilot

An API (Application Programming Interface) is the code-first way to interact with AI. Instead of typing in a chat window, you send a structured request to a service and get a structured response back. APIs let you integrate AI capabilities into applications, automate workflows programmatically, and access model capabilities beyond what the chat UI provides.

Every major AI platform exposes its models through APIs. The same model you chat with in a browser can be called from a Python script, a web application, or an automated pipeline — with full control over parameters, inputs, and outputs.

  • Stateless request/response pattern — send a request with your input, get a response with the output; each call is independent unless you manage state yourself
  • Authentication via API keys — access is controlled by secret keys tied to your account, with usage tracked and billed per call
  • Platform-agnostic — any programming language that can make HTTP requests can call an API; no vendor lock-in at the protocol level
  • Metered by usage — billed by tokens processed, API calls made, or compute consumed, giving fine-grained cost control

Use APIs when:

  • You need to integrate AI into an existing application or product
  • You’re automating a workflow that runs programmatically (batch processing, scheduled tasks, pipelines)
  • You need control over parameters the chat UI doesn’t expose (temperature, max tokens, structured outputs)
  • You’re building a product or internal tool powered by AI
  • You need to process data at scale (hundreds or thousands of inputs)

Calling the Claude API from a Python script to classify 1,000 customer support tickets overnight — each ticket gets sent as a request with classification instructions, and the response contains the category, priority, and a brief summary. No human sits at a chat window; the script runs unattended and writes results to a database.

Or calling a search API to enrich an agent’s research — the agent programmatically queries Google, retrieves results, and synthesizes them into a report.

APIs aren’t limited to AI models. A typical AI workflow might call several types:

API TypeWhat It DoesExamples
Model APIsSend prompts to AI models and receive generated responsesAnthropic API, OpenAI API, Google Gemini API
Cloud service APIsAccess platform capabilities like search, translation, or storageGoogle Search API, AWS Translate, Azure Cognitive Services
Third-party service APIsRead from and write to business toolsSlack API, GitHub API, HubSpot API, Notion API
Data APIsQuery databases or data warehousesBigQuery API, Snowflake API, Elasticsearch API

Endpoints — The specific URL you send requests to. Each capability has its own endpoint (e.g., /messages for sending a prompt, /embeddings for generating vector representations).

Authentication — Most APIs require an API key sent in the request header. Keys are tied to your account and control access, rate limits, and billing.

Request/response format — APIs typically use JSON. You send a structured request (model, messages, parameters) and receive a structured response (generated text, metadata, usage stats).

Rate limits — APIs limit how many requests you can make per minute or per day to ensure fair usage. Production applications need to handle rate limiting gracefully.

Streaming — For long responses, many APIs support streaming — sending the response back in chunks as it’s generated, rather than waiting for the full response.

Structured outputs — Many model APIs can return responses in a specified JSON schema, making it easy to parse results programmatically without brittle text extraction.

PlatformHow It WorksAPI Reference
Claude (Anthropic API)REST API with Messages endpoint; Python and TypeScript SDKs available; supports streaming, tool use, and visionDocs · API Reference
OpenAI APIREST API with Chat Completions and Responses endpoints; Python and TypeScript SDKs available; supports streaming, function calling, and structured outputsDocs · API Reference
Google (Gemini API / Vertex AI)REST API with generateContent endpoint; Python SDK available; Vertex AI adds enterprise features and additional model accessGemini API Docs · API Reference
Azure AI ServicesREST APIs for OpenAI models (via Azure OpenAI) and cognitive services (vision, speech, language); .NET, Python, Java SDKsDocs · API Reference

API is the programmatic bridge between your code and AI capabilities:

  • Model is accessed through APIs — the API is how you call the model from code
  • Prompts are sent as structured messages in API requests
  • Context is included as system messages, file attachments, or retrieved data in API calls
  • Skills can wrap API calls into reusable routines
  • Agents use APIs to call models, tools, and services as part of their autonomous execution
  • MCP servers often wrap APIs — providing a standard interface for agents to call external services
  • SDKs provide higher-level abstractions over raw API calls, handling orchestration, retries, and tool use patterns
  • CLI tools abstract over APIs to give humans a conversational terminal interface to AI models
  • Agentic Building Blocks — API in the context of all building blocks
  • SDK — frameworks that provide higher-level abstractions over APIs
  • MCP — the protocol that connects AI to external systems (often backed by APIs)
  • Agents — autonomous systems that use APIs to call models and tools
  • AI Use Cases — what teams build with these blocks
  • Coding Use Cases — code-first AI workflows that rely on APIs
  • Automation Use Cases — automated pipelines built on API calls
  • CLI — terminal-native interfaces that abstract over APIs
  • Platforms — platform-specific API guides