# API-first development — Routebase

> Routebase turns API-first development into one workflow, so you review the OpenAPI contract like code, and frontend, QA, backend and agents build against the same published version without waiting for each other.

Canonical page: https://routebase.dev/api-first-development/

In many teams the API contract is written last, as an export of whatever the code ended up doing. So the frontend waits for the backend, QA tests a moving target, and the review that would have caught the awkward endpoint comes after a week of implementation. API-first development turns that order around. The contract is designed and agreed before anyone writes a handler, and from that moment every team builds against it at once. Whether you call it design-first or API-first, the order is the point, and Routebase is built around it. Here the contract is a versioned OpenAPI spec with branches and merge requests, and publishing freezes a version that nothing reopens. The mock server answers from that version on a stable URL, test suites report pending rather than red until the endpoints land, and the docs portal is generated from the same version. An agent reads that version over MCP as well, under the same permissions as the team.

## The contract comes first, in an editor built for it

You design endpoints, schemas and responses in a visual OpenAPI editor, and the spec you leave with is the artefact that everything downstream reads.

- Visual OpenAPI 3.x editor with reusable schemas, parameters and response components
- Start from a template, an imported spec or a Postman collection, or from an empty spec
- Style guide findings appear in the editor while you design, before a review is opened
- Versions move from draft through review to published, so everyone knows which contract is settled

## Reviewed like code before anyone builds on it

A change to the contract is a diff a reviewer can judge in minutes, so Routebase gives it branches, merge requests and a merge policy instead of a comment thread.

- Spec branches from a draft version, with merge requests and at least one required reviewer
- 21 breaking-change rules classify the diff, and a breaking branch needs an Admin or Owner approval
- Rebase shows every conflict with both sides next to each other, before the merge rather than after
- Reviewing and merging are separate permissions, so Members propose and Admins decide what lands

## API-first development means nobody waits for the backend

The moment a version is published, the mock answers from it, the suites run against it, and an agent reads it over MCP, so every team starts on the same day.

- Mock rules generated from the spec on a stable URL per project, following the draft while you design
- Test cases imported from the spec, one per endpoint with the contract assertions filled in
- Pending instead of red while an endpoint is not implemented yet, so the first real failure stands out
- Monitors created before the service ships wait for deployment instead of paging anyone

## Ship it, and let the contract say what is live

Routebase never deploys your service, so your pipeline reports which version an environment runs, and the contract tests verify that claim against the live API.

- Releasing freezes the version into an immutable snapshot, and a frozen contract never changes
- One command in the deploy job, routebase promote, pins the environment to what actually shipped
- Contract tests and monitors validate against the pinned version, and a pin that fell behind is flagged
- Roll back moves the pin, and the promotion history says who set it and whether the pipeline reported it

## Frequently asked questions

### What is API-first development?

API-first development writes and agrees the API contract before the implementation, as an OpenAPI spec that the mock server, the tests and the documentation derive from. The backend then implements the contract rather than defining it, and the teams that consume the API build against the agreed version in parallel. The order is the whole idea, because a contract that exists first can be reviewed, mocked and tested before a line of handler code is written.

### Is API-first the same as design-first?

In practice, yes. Design-first describes the same order from the perspective of the person writing the contract, while API-first describes it from the perspective of an organisation that treats the API as a product. Routebase supports both readings with the same workflow, so the spec is the artefact that gets designed, reviewed, published and built against.

[Design-first vs. code-first, the argument in full](https://routebase.dev/blog/design-first-vs-code-first/)

### What happens to my tests before the backend exists?

They report pending rather than failed. A case whose endpoint refuses the connection or answers 404 on a path the contract describes is marked pending, with its own counter next to the run summary, and pending never fails the run. As the endpoints land, cases move from pending to passed one by one, and the day a case goes red it means the service answered wrongly.

[Contract tests against an unbuilt endpoint](https://routebase.dev/guides/api-testing/contract-testing-vs-integration-testing/)

### Which plan do I need for this workflow?

The Free plan has one seat and covers the whole loop for one person, from the editor to the mock server, the tests and the docs portal. Starter adds unlimited users and the test import from the spec, which is what a team building in parallel needs. Pro adds spec branches, merge requests, the style guide and monitoring, and every new workspace starts on a 14-day Pro trial without a credit card.

[Compare the plans](https://routebase.dev/pricing/)

### Can an AI agent take part in an API-first workflow?

Yes, over the MCP server every workspace ships. An agent reads the published version, drafts endpoints on a branch, generates a test suite and runs it against an environment, all under the permissions of the person whose key it uses. Publishing still needs the publish permission, which Members do not hold, so an agent working on a Member's key cannot release a contract nobody reviewed.

[The MCP server, in detail](https://routebase.dev/mcp-server/)

---

[Routebase](https://routebase.dev/) — [Sign up](https://app.routebase.dev/): Every account starts with a 14-day Pro trial — no credit card required.
