# OpenAPI spec

> A machine-readable description of an HTTP API: its endpoints, parameters, request bodies, responses and auth.

An OpenAPI specification is a JSON or YAML document that describes an HTTP API in a standard structure. It lists every path and method, the parameters each one accepts, the shape of request and response bodies as schemas, the possible status codes, and how clients authenticate. Because the format is standard, tools can read it without knowing anything else about the API.

That is where most of its value comes from. One spec can generate client libraries in several languages, power interactive reference docs, drive mock servers and contract tests, and be imported into API tools so you can try calls without writing code. When the spec is the source of truth, docs and SDKs stay in sync with the real API.

For AI agents, an OpenAPI spec is a compact map of what an API can do. Agent frameworks can turn operations into callable tools, and a model can read the schemas to build valid requests instead of guessing field names from prose documentation.

## How Dizo handles it
Dizo publishes an OpenAPI 3.1 spec at https://dizo.ai/openapi.json, alongside /llms.txt, /llms-full.txt and a Markdown twin of every page (append `.md`). The base URL is `https://api.dizo.ai/v1`, and every billable endpoint accepts `dry_run` and `max_credits`. Agents that prefer tools can use the MCP server instead.

Docs: [/docs/search](https://dizo.ai/docs/search.md), [/docs/email-find](https://dizo.ai/docs/email-find.md), [/docs/pricing](https://dizo.ai/docs/pricing.md), [/docs/me](https://dizo.ai/docs/me.md)

Related terms: [llms.txt](https://dizo.ai/glossary/llms-txt.md), [MCP (Model Context Protocol)](https://dizo.ai/glossary/mcp-model-context-protocol.md), [Tool calling](https://dizo.ai/glossary/tool-calling.md), [API key](https://dizo.ai/glossary/api-key.md)


## What an OpenAPI spec is

An OpenAPI spec is a structured document, written in JSON or YAML, that describes an HTTP API completely enough for software to understand it. It names the servers the API runs on, lists every path and method, defines the parameters and request bodies each operation accepts, describes every response with a schema, and explains how clients authenticate. The OpenAPI Specification itself is the open standard that defines how such documents are laid out.

The format grew out of the earlier Swagger specification, and you will still see the name Swagger on many tools that read and display OpenAPI documents. Current specs declare their version at the top, such as `openapi: 3.1.0`. Version 3.1 aligned its schema language with JSON Schema, which means the same schema tooling can validate API payloads and other JSON data.

A spec is not documentation prose. It is a contract. Human-readable docs are often generated from it, but its main audience is software: code generators, test tools, gateways and, increasingly, AI agents.

## What a spec contains

Most OpenAPI documents follow the same top-level layout. Knowing it makes any spec easier to read, whether you open it in a text editor or a viewer.

Schemas are the part most worth studying. A good spec defines shared objects once, such as a person or a company, and references them from every operation that returns them. That makes it clear that the person returned by search has the same shape as the person returned by enrichment.

- **info:** the API's title, version and description.
- **servers:** the base URLs, such as a production API root.
- **paths:** every endpoint, with its methods, parameters, request body and responses.
- **components:** reusable schemas, parameters, responses and security schemes.
- **security:** which authentication schemes apply, such as a bearer token.
- **tags:** groupings that docs tools use to organize operations.

## Why OpenAPI specs matter for GTM teams and AI agents

For engineering teams integrating a data provider, a spec removes guesswork. Instead of copying field names from web pages, you generate a typed client, and your editor flags a misspelled parameter before the code ever runs. When the provider adds a field, regenerating the client picks it up.

For RevOps and workflow builders, many API tools can import a spec and present each operation as a ready-made request. That turns a long integration task into choosing an operation, filling in parameters and testing it, which is often enough for internal automations.

For AI agents, the spec is a dense, structured description of capabilities. Agent frameworks can convert operations into tools with typed inputs, and models can read schemas to build valid requests. A model given a spec makes far fewer mistakes than one given only marketing copy, because the schema tells it exactly which fields exist and which are required. See [tool calling](/glossary/tool-calling) for how models use those definitions.

## How teams use an OpenAPI spec

The most common use is **code generation**. Open-source generators read a spec and produce client libraries in many languages, with one method per operation and typed models for requests and responses. Teams that integrate several APIs often prefer this to hand-written HTTP calls.

The second use is **documentation and exploration**. Reference docs, interactive consoles and API clients can render a spec so you can browse endpoints and send test requests. The third is **testing**: contract tests compare real responses with the schemas in the spec, and mock servers built from a spec let front-end or agent work start before the real integration is ready.

A fourth use is **governance**. Linters check specs for consistent naming, missing descriptions and breaking changes between versions, which keeps a large API predictable for the people and programs that depend on it.

## Common mistakes and misconceptions

A frequent misconception is that a published spec is automatically correct. Specs are written by people or generated from code, and both can drift from reality. Treat the spec as the provider's intended contract, test the calls you depend on, and report differences you find.

A second mistake is feeding a whole spec to a model on every turn. Large specs can run to thousands of lines and fill a context window with operations the agent will never use. Load only the operations relevant to the task, or use a tool layer, such as an MCP server, that already exposes a curated set of tools with short descriptions.

A third mistake is ignoring what the spec cannot express. Costs, sensible defaults, rate limits and business rules like "only charged if found" are often only in prose. An agent that reads only the schema may build a valid request that is still a bad idea. Pair the spec with the provider's agent guidance.

## How to evaluate an API's OpenAPI spec

Start with coverage. Does the spec include every endpoint you plan to use, with request and response schemas, not just paths? Then check descriptions: each operation and important field should say what it does in plain language, because generated docs and AI agents both rely on those strings.

Next, check error responses. A spec that documents only the success case leaves your code guessing about failures. Look for documented error shapes with stable codes. Finally, check freshness: is the spec served from a stable URL, and does it change when the API changes?

A quick practical test is to generate a client and make one real call. If the generated types match the response you get back, the spec is in good shape.

## How OpenAPI shows up in Dizo

Dizo publishes an OpenAPI 3.1 spec at `https://dizo.ai/openapi.json`. It sits alongside other machine-readable entry points: `https://dizo.ai/llms.txt` as an index, `https://dizo.ai/llms-full.txt` as the full reference in text, an MCP manifest, and a Markdown twin of every page that you get by appending `.md` to the URL. The [machine-readable docs](/features/machine-readable-docs) page describes how they fit together.

The REST base URL is `https://api.dizo.ai/v1`, and requests authenticate with `Authorization: Bearer` and your key. Every billable endpoint accepts `dry_run` for a free quote and `max_credits` as a hard ceiling, errors carry stable codes with a plain-English `fix`, and `Idempotency-Key` makes POST retries safe. Live prices are available at `GET /v1/pricing` with no authentication.

If your agent works through tools rather than raw HTTP, the [MCP server](/mcp) at `https://mcp.dizo.ai/mcp` exposes every API as a tool with its credit cost in the description. Many teams use the spec for backend code and MCP for agents.

## Worked example: from spec to first call

An engineer building an enrichment service downloads the spec and generates a client for their language. They configure it with the base URL and a `dz_test_` key, which returns synthetic data and never spends credits. They write the code path for the email finder and the person enrich operations, including handling the `404 not_found` response for misses, and run their test suite against the sandbox.

When the integration is ready and they have a live key, they switch keys and run a small pilot of 500 email lookups. Before running it, they send the same requests with `"dry_run": true` to confirm the quote. Suppose 430 emails are found: at 1 credit each, the pilot costs 430 credits, or $10.75 at the pay-as-you-go rate of $0.025 per credit. The 70 misses are free.

From there, the same generated client handles batch jobs and billing checks, because every endpoint they need is in the one spec.

## Related concepts

[llms.txt](/glossary/llms-txt) is a lighter-weight companion to a spec: a Markdown index that points language models to the right pages. The Model Context Protocol is another way to describe capabilities to agents, as tools rather than as HTTP operations.

API keys and OAuth appear in a spec as security schemes, which tell clients how to authenticate. Rate limits and pricing are usually described elsewhere, so read them alongside the spec before running large jobs.

## FAQ

### What is the difference between OpenAPI and Swagger?
OpenAPI is the current name of the specification format, which grew out of the earlier Swagger specification. Swagger is still the name of a family of tools that work with OpenAPI documents, which is why the two terms are often used together.

### Is an OpenAPI spec written in JSON or YAML?
Either. The structure is the same, and tools generally accept both. JSON is common for published specs that programs download; YAML is often preferred when people edit the spec by hand.

### Can an AI agent use an OpenAPI spec directly?
Yes. Many agent frameworks can turn spec operations into callable tools, and models can read the schemas to build valid requests. For large APIs, load only the operations the agent needs to save context.

### Should I use the OpenAPI spec or the MCP server for Dizo?
Use the spec when you write backend code or generate a client. Use the MCP server when an AI assistant or agent framework should call Dizo as tools. Both reach the same APIs.

### Where is Dizo's OpenAPI spec?
At `https://dizo.ai/openapi.json`, in OpenAPI 3.1 format. Dizo also publishes `/llms.txt`, `/llms-full.txt` and a Markdown version of every page.

### Does the spec tell me what each call costs?
Pricing rules such as "only charged if found" are clearest in the pricing docs. Dizo publishes per-endpoint costs, live prices at `GET /v1/pricing` with no auth, and an exact quote for any request with `"dry_run": true`.
