From OpenAPI spec to
working tests with AI
Give ChatGPT (or any AI assistant) the Clear Signal prompt and your OpenAPI document. It writes a bundle of environments and scenarios that you import into Clear Signal in one step and run from the desktop app or the CLI.
Start with these three documents
The assistant needs all three. Together they tell it what to do, what the file formats look like, and what a good scenario looks like.
Shortcut: in the desktop app, open the AI Prompt help page and click Copy AI Prompt. It puts all three documents on your clipboard as one prompt.
How to generate and import your tests
- 1
Collect the three documents
Open the AI Prompt, Format Specification and Example Scenario linked above. In the desktop app you can skip the copying: open the AI Prompt help page and click Copy AI Prompt. It copies the instructions, the format spec and the example as one prompt.
- 2
Start a chat and paste the prompt
Open ChatGPT (or Claude, Gemini, or any assistant) and paste the full prompt as your first message. If you are pasting the documents by hand, paste them in this order: AI Prompt, Format Specification, Example Scenario.
- 3
Give it your OpenAPI document
Paste your OpenAPI 3.x spec (JSON or YAML), or give the assistant a URL if it can browse. For very large specs, paste only the paths and schemas you care about first.
- 4
Answer its questions, then reply "go"
The assistant summarises your API, asks up to five short questions (environments, authentication, whether tests may create and delete data, focus), and proposes a list of scenarios. Reply "go" to generate, or tell it what to change.
- 5
Copy the bundle
It replies with one YAML code block: your environments, optional reusable requests and several scenarios. Copy that block. Below it, the assistant lists the variables you need to fill in, its assumptions, and anything it left out.
- 6
Import it into Clear Signal
In the desktop app choose File → Import → Bundle (environments + scenarios)…, paste the block and click Import. Select the new environment, replace placeholders such as CHANGE_ME with real values, and run. Prefer the terminal? Save the block as bundle.yaml and run clrsig bundle run bundle.yaml.
What the assistant gives you
One YAML bundle. It has the same shape every time, so you can review it like any other file.
schemaVersion: "1"
title: User API tests
description: Login, user lifecycle and one negative check.
environments:
- name: local
variables:
- name: baseUrl
value: "http://localhost:8090"
- name: password
value: CHANGE_ME
secret: true
requests:
- file: login
title: Log in
method: POST
url: "{{baseUrl}}/auth/login"
scenarios:
- title: User lifecycle
file: user-lifecycle
steps:
- label: Log in
requestRef: login
- label: Create user
- label: Read user
- label: Delete user Abbreviated for illustration. Real bundles include assertions and extractions for every step.
Run it in the app or the CLI
Save the assistant's code block as bundle.yaml. Import it into the desktop app, or let the clrsig bundle CLI validate, run or import it (new in v0.4.0).
Desktop app
Choose File → Import → Bundle (environments + scenarios)…, paste the code block and click Import. Select the new environment, fill in the placeholders, open a scenario and run it.
CLI and CI (clrsig bundle)
Check the bundle, then run every scenario in it directly, locally or in your pipeline. Exit code 1 means a scenario failed; 2 means the bundle is invalid.
# check it without running anything
clrsig bundle validate bundle.yaml
# run all scenarios (--env when it has several)
clrsig bundle run bundle.yaml --env local
# or save its files into a workspace
clrsig bundle import bundle.yaml -w ./ws Share the results as an HTML report
Add --format html to get one self-contained page covering every scenario in the bundle. Open it in a browser, attach it to a ticket, or keep it as a CI artifact. It leaves out extracted variable values, so a token from a login response doesn't end up in a file you share.
clrsig bundle run bundle.yaml --env local \
--format html --output reports/run.html Or let an AI agent run it (MCP)
Instead of copying a prompt into a chat, an agent such as Claude Desktop or Cursor can call Clear Signal directly. clrsig mcp starts a Model Context Protocol server on stdin/stdout, exposing the conform, run_scenario, diff and coverage tools. It opens no network port. conform and run_scenario send only GET and HEAD unless you allow writes (from 0.20.0), and attach files only from the folders you give the server (from 0.20.1). That does not make an agent safe: a GET can change data, or send a secret, or a file from those folders, to any address.
clrsig mcp Tips for better results
- Paste the spec itself. The prompt tells the assistant never to guess an API from its name or URL.
- Say what you want covered: smoke tests, full create/read/update/delete lifecycles, negative tests, or pagination.
- Keep it focused. For a large API, ask for one area (a tag or a path prefix) at a time.
- Use a local or staging server first, and review the assumptions the assistant lists after the bundle.
- Never paste real passwords, tokens or API keys into the chat. Fill them in inside Clear Signal after the import.
Frequently asked questions
Which AI assistants work?
Any chat assistant that accepts a long prompt: ChatGPT, Claude, Gemini and similar. The prompt is plain text, so there is nothing to install and no API key to give Clear Signal.
Can an AI agent run Clear Signal directly instead of me pasting a prompt?
Yes. clrsig mcp starts a Model Context Protocol server on stdin/stdout with the tools conform, run_scenario, diff and coverage, so agents such as Claude Desktop or Cursor can run Clear Signal for you. It opens no network port. conform and run_scenario send only GET and HEAD unless you allow writes (from 0.20.0), and attach files only from the folders you give the server (from 0.20.1). That does not make an agent safe: a GET can change data, or send a secret, or a file from those folders, to any address. The paste-a-prompt flow above is the one that generates an importable bundle.
Can I get a report to share after running a bundle?
Yes. Run clrsig bundle run bundle.yaml --format html --output reports/run.html for one self-contained page covering every scenario. It leaves out extracted variable values, so tokens from login responses are not written to the file. JUnit and JSON formats are also available.
Does it work with Swagger 2.0?
Yes, with a limit. Bundles for Swagger 2.0 documents use status, JSONPath and header assertions. Schema assertions and spec binding (specFile) need an OpenAPI 3.x document, and the prompt tells the assistant to leave them out for Swagger 2.0.
Do I need a spec file for schema checks?
If you gave the assistant a URL to an OpenAPI 3.x document, it sets specFile for you. If you pasted the spec instead, save it to a file and enter its path in the Spec file field of the import dialog so the schema checks can run.
Should I paste real credentials into the chat?
No. The prompt tells the assistant to write placeholders such as CHANGE_ME and mark them as secrets. Fill in the real values inside Clear Signal after importing, where secret values are masked in history and reports.
Is it safe to run the generated tests?
Review them first, and start against a local or staging environment. The prompt asks the assistant to only delete data its own scenario created, but you are responsible for what runs against your API. The assistant lists its assumptions after the bundle, so check those.
Don't have Clear Signal yet?
Free, open source, no account required. Desktop app for Windows, macOS and Linux, plus a CLI.
Download Clear Signal