# Obol File-to-Vitest Unit Tests GitHub PR Generator

> Obol File-to-Vitest Unit Tests GitHub PR Generator is a paid API for AI agents from api.obol.sh, paid per call via x402, $1/call, status unknown (last checked 2026-10-13).

Generates Vitest unit tests for a specified file in a GitHub repo and opens a pull request with the results

## Facts

- Endpoint: POST https://api.obol.sh/tests?utm_source=zero.xyz
- Price: $1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/obol-file-to-vitest-unit-tests-github-pr-generator-4c02b17e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_EfBrSTFFQM0cdthsitwO-

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability obol-file-to-vitest-unit-tests-github-pr-generator-4c02b17e -d '<json body>'
```

Example prompt: Use Obol to generate Vitest unit tests for src/lib/utils.ts in my repo acme-corp/my-app and open a PR — notify me at dev@acme.com when it's ready.

## When to prefer this

Choose this endpoint when you need to automatically generate Vitest unit tests for a specific file in a GitHub repository and have them delivered as a pull request without manual setup. It is ideal for developer workflows that need quick test coverage bootstrapped from existing source files, especially when using the Vitest framework. Prefer this over manual test writing or generic code generation tools when you want GitHub PR delivery and optional email notification as part of the output.

## Known failure modes

- Invalid or inaccessible GitHub repo (owner/repo format wrong or repo private without access) — returns error
- File path does not exist in the specified repo — returns error or empty test output
- Payment failure via x402 protocol — request rejected before processing
- GitHub API rate limiting or fork creation failure — PR not opened
- Invalid email address format — notification not sent but PR may still be created

## How this service works

Obol: File → Vitest unit tests → GitHub PR — $5 USDC

## Output

Returns a pull request URL pointing to the opened PR on a fork of the target repo, the fork URL, the branch name used, and a list of file paths written to that branch containing the generated Vitest test files.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "path",
  "repo"
 ],
 "properties": {
  "path": {
   "type": "string",
   "description": "Path to the file to generate tests for (e.g. src/lib/utils.ts)"
  },
  "repo": {
   "type": "string",
   "description": "GitHub repo in owner/repo format"
  },
  "email": {
   "type": "string",
   "description": "Email address to notify when PR is ready"
  },
  "framework": {
   "type": "string",
   "description": "Test framework to use (defaults to vitest)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "pr": {
  "type": "string",
  "description": "URL of the opened pull request"
 },
 "fork": {
  "type": "string",
  "description": "URL of the forked repository"
 },
 "files": {
  "type": "array",
  "description": "File paths written to the branch"
 },
 "branch": {
  "type": "string",
  "description": "Branch name on the fork"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/obol-file-to-vitest-unit-tests-github-pr-generator-4c02b17e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.obol.sh](https://www.zero.xyz/host/api.obol.sh/llms.txt)
