# apiacre.com OpenAPI Test Generator

> apiacre.com OpenAPI Test Generator is a paid API for AI agents from apiacre.com, paid per call via x402, $0.1/call, status unknown (last checked 2026-09-16).

Generates deterministic, syntax-validated pytest and requests smoke tests from a caller-supplied OpenAPI 3 document, with mutating operations disabled by default.

## Facts

- Endpoint: POST https://apiacre.com/v1/developer/openapi-test-generate
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/apiacre-com-openapi-test-generator-21213d3b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zThieZpnBI9-XZkgk4wbE

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 apiacre-com-openapi-test-generator-21213d3b -d '<json body>'
```

Example prompt: Take this OpenAPI 3 spec and generate a deterministic pytest and requests smoke test file from it — keep all mutating operations (POST, PUT, DELETE) disabled by default.

## When to prefer this

Choose this endpoint when you need to quickly scaffold a deterministic, ready-to-run pytest smoke test file directly from an OpenAPI 3 specification without writing tests manually. It is especially useful for CI/CD integration, contract validation, and onboarding to third-party APIs where a spec is available but no test suite exists.

## Known failure modes

- Invalid or malformed OpenAPI 3 document returns a validation error
- Non-OpenAPI 2/3 documents (e.g. plain JSON schemas) may be rejected
- Very large specs may exceed payload limits
- Missing required fields in the OpenAPI document may cause partial test generation
- Network timeout if the spec document is excessively large

## How this service works

Generate deterministic, syntax-validated pytest and requests smoke tests from a caller-supplied OpenAPI 3 document, with mutating operations disabled by default.

## Output

Returns a pytest-compatible test file with syntax-validated smoke tests covering the endpoints defined in the supplied OpenAPI 3 document. Mutating operations (e.g. POST, PUT, DELETE) are disabled by default. Tests use the requests library and are deterministically generated from the spec structure.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "format": {
   "enum": [
    "json",
    "yaml"
   ],
   "type": "string"
  },
  "base_url": {
   "anyOf": [
    {
     "type": "string"
    },
    {
     "type": "null"
    }
   ]
  },
  "document": {
   "type": "string"
  },
  "api_key_env": {
   "type": "string"
  },
  "max_operations": {
   "type": "integer"
  },
  "timeout_seconds": {
   "type": "integer"
  },
  "bearer_token_env": {
   "type": "string"
  },
  "include_optional": {
   "type": "boolean"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "source": "\"\"\"Generated API smoke tests. Review targets and payloads...",
   "apiTitle": "Widget API",
   "warnings": [],
   "execution": {
    "networkRequestsMade": false,
    "sourceSyntaxValidated": true,
    "generatedTestsExecuted": false
   },
   "truncated": false,
   "operations": [
    {
     "path": "/health",
     "method": "GET",
     "testName": "test_gethealth",
     "operationId": "getHealth"
    }
   ],
   "environment": {
    "apiKey": "API_KEY",
    "baseUrl": "API_BASE_URL",
    "bearerToken": "API_BEARER_TOKEN",
    "allowMutatingTests": "API_ALLOW_MUTATING_TESTS"
   },
   "requirements": [
    "pytest>=8",
    "requests>=2.31"
   ],
   "sourceSha256": "44d05573bd64ef63deb934c9bef7b1ed6c618e4093c9cc7eee8e3a55b...",
   "baseUrlDefault": "https://api.example.com",
   "documentSha256": "2f27879b24323466c5dbca7df9bf137561b826bd43c318b8642b92f04...",
   "openapiVersion": "3.1.0",
   "operationCount": 2,
   "sourceFileName": "test_openapi_generated.py",
   "generatedTestCount": 2,
   "guardedMutationCount": 1
  },
  "meta": {
   "cached": false,
   "sources": [],
   "warnings": [],
   "duration_ms": 42,
   "next_actions": [
    {
     "title": "Code metrics",
     "method": "POST",
     "reason": "Measure the generated pytest module's structure, complexi...",
     "service": "developer.code-metrics"
    }
   ]
  },
  "service": "developer.openapi-test-generate",
  "version": "1",
  "request_id": "018f1f54-7f38-7ba2-8dc3-5f90272d9f1a"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/apiacre-com-openapi-test-generator-21213d3b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from apiacre.com](https://www.zero.xyz/host/apiacre.com/llms.txt)
