Migrating from Optic to DocSemantic
You used Optic. Here's how to move to DocSemantic. It keeps using your OpenAPI files and fits into CI, but it checks live responses rather than diffing spec versions. The differences are listed below so you can decide whether it fits.
1. Gather what you already have
Everything Optic used still applies. Find your optic.yml (usually at the repo root) and the OpenAPI/Swagger files it points to. The OpenAPI files are what matter — DocSemantic uses them as your contract unchanged. A typical config looks like this:
# optic.yml — a typical Optic v0.50+ project config
files:
- path: ./openapi.yml
id: orders-api
capture:
openapi.yml:
server:
command: npm start
url: http://localhost:8080
requests:
run:
command: npm testFrom this file, DocSemantic picks up the API name under capture. The openapi.yml it refers to is what we check traffic against, so you'll paste or upload that file in the next step.
No spec on hand? That's fine too — DocSemantic can learn your contract from live traffic, so you can skip straight to sending samples.
2. Import into DocSemantic
Sign up, then open Import from Optic and paste your optic.yml together with the OpenAPI file it references. We can't fetch paths from your repo, so the spec itself has to be pasted or uploaded. Each spec becomes a contract. Then point CI at it with the GitHub Action below.
3. Swap your CI gate
Replace the Optic diff step with the DocSemantic Spec Check Action. Store your key as a repo secret named DOCSEMANTIC_API_KEY. The step fails when the hosted check reports drift, so it can still block merges, but it checks something different from optic diff (see what's different).
Before
# .github/workflows/api.yml — BEFORE (Optic)
name: API checks
on: [push, pull_request]
jobs:
optic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: npx @useoptic/optic diff openapi.yml --base main --check # no longer maintainedAfter
# .github/workflows/api-drift.yml — AFTER (DocSemantic)
name: API drift
on: [push, pull_request]
jobs:
drift:
runs-on: ubuntu-latest
steps:
# fails the step when the hosted check reports drift
# (set fail-on-drift: "false" to report without failing)
- uses: LingodocApi/docsemantic-action-check-spec@v1
with:
api-key: ${{ secrets.DOCSEMANTIC_API_KEY }}4. Optional extras
Once your contracts are in, these are available if you want them:
- Plain-English AI explanations of drift (counts toward your plan's AI generations).
- Spec-update pull requests for drift you decide is intentional — always opened for review, never merged automatically.
- Consumer tracking that shows which caller sent the request whose response drifted.
- Scheduled checks on production traffic, so drift shows up outside CI too.
What's different from Optic
DocSemantic isn't a drop-in replacement for Optic. Read this before you migrate.
- It checks a different thing
- optic diff compares two versions of your spec (base vs. head) for breaking changes. DocSemantic compares how your API actually responds against its contract. If you need spec-vs-spec breaking-change diffs, keep a tool like oasdiff alongside.
- No rulesets or spec linting
- Optic's rulesets (breaking-changes, naming, examples) aren't supported. Use Spectral for linting.
- Traffic comes from your app, not a capture proxy
- Optic's capture block started your server and ran your tests through a proxy. DocSemantic doesn't run those commands — traffic arrives through the SDK or ingest API. Endpoints that receive no traffic are not checked.
- The import reads part of optic.yml
- We read API names from capture (and older apis entries). We don't read files, ruleset, or your capture commands, and we can't fetch spec paths from your repo — paste or upload the OpenAPI file itself.
- The CI step checks your workspace, not the PR's files
- The Action calls the hosted check for every contract in the workspace tied to your API key. It doesn't read openapi.yml from the commit, and it doesn't post a PR comment — results appear in the job log and step outputs.
Common questions
- Do I have to rewrite my optic.yml or specs?
- No rewriting. Your OpenAPI/Swagger files are used as they are. optic.yml is only read for API names, so you'll paste or upload the spec files themselves.
- Will my CI behave the same way?
- Partly. The step still fails the build when drift is found, but it compares real responses against your contract instead of diffing two spec versions. Because of that, it won't flag a breaking edit to the spec file on its own.
- What does it cost to move over?
- Nothing to start. The free tier is forever-free for a single developer with no card required, so you can migrate and validate before deciding on a paid plan. See pricing.
- What if I never had a spec — only Optic capturing traffic?
- DocSemantic can learn a contract from live samples sent through the SDK or ingest API, so a spec isn't required. It only learns endpoints that actually receive traffic, though, and it won't run Optic's capture commands for you.
Ready to move your drift checks over?
Free for solo developers, no card required. Import your specs and keep shipping.