Learn how to authenticate your requests to the Chekov API using API keys.
Keep your API key secure and never share it publicly. If your key is compromised, you can generate a new one from the dashboard.
Include your API key in the Authorization header of all API requests:
Authorization: Bearer your-api-keycurl -X POST https://chekov.ai/api/chekov \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Click the login button",
"html": "<button>Login</button>",
"screenshot": "base64-encoded-image"
}'When using the @chekov/core package, set your API key as an environment variable:
export CHEKOV_API_KEY="your-api-key"set CHEKOV_API_KEY=your-api-key$env:CHEKOV_API_KEY="your-api-key"| Status Code | Error Message | Description |
|---|---|---|
| 401 | Missing API key | No API key was provided in the request |
| 403 | Invalid API key | The provided API key is not valid |
When using Chekov in CI/CD pipelines, securely store your API key as a secret or environment variable:
name: Run Tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
env:
CHEKOV_API_KEY: ${{ secrets.CHEKOV_API_KEY }}
run: npm testtest:
script:
- npm test
variables:
CHEKOV_API_KEY: $CHEKOV_API_KEY