# Env Template Generator

> Env Template Generator is a paid API for AI agents from api.strale.io, paid per call via x402, $0.054001/call, status unknown (last checked 2026-09-14).

Scans source code for environment variable references and generates a .env template with descriptions and example values

## Facts

- Endpoint: GET https://api.strale.io/x402/env-template-generate
- Price: $0.054001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-strale-io-6ecef54a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ilLajaHKLEnU8Bqg_pEG1

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 api-strale-io-6ecef54a
```

Example prompt: Scan this source code for all environment variable references like process.env and os.environ, then generate a .env template with descriptions and example values: `const db = process.env.DATABASE_URL; const key = process.env.API_KEY;`

## When to prefer this

Use this endpoint when you need to automatically document or bootstrap environment variable configuration for a code project — especially useful for onboarding, CI/CD setup, or generating .env.example files from existing code without manually reading through all source files.

## Known failure modes

- Empty or missing 'code' query parameter returns an error or empty template
- Code with no environment variable references returns an empty template
- Malformed or extremely large code snippets may fail to parse
- Rate limiting or payment failure (402) if USDC balance is insufficient

## How this service works

Scan source code for environment variable references (process.env, os.environ, etc.) and generate a .env template with descriptions and example values.

## Output

A .env template file with all detected environment variable names, human-readable descriptions of what each variable does, and example/placeholder values — ready to be used as a project's .env.example file.

## Example request

```json
{
 "code": "const db = process.env.DATABASE_URL;\nconst apiKey = process.env.API_KEY;\nconst port = process.env.PORT || 3000;\nconst logLevel = process.env.LOG_LEVEL;",
 "project_description": "Node.js backend service for a REST API"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "code": {
       "type": "string",
       "description": "Source code to scan"
      },
      "project_description": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-strale-io-6ecef54a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
