# OmniAPI AI Code Generator

> OmniAPI AI Code Generator is a paid API for AI agents from omni-api-cyan.vercel.app, paid per call via x402, $0.088835/call, status unknown (last checked 2026-09-15).

Generates code snippets or complete code solutions from a natural language query using AI, paid per call via USDC x402

## Facts

- Endpoint: POST https://omni-api-cyan.vercel.app/api/ai/code/generate
- Price: $0.088835/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/omniapi-ai-code-generator-38f7edd6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__0CjH51goVutt3tLkdlem

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 omniapi-ai-code-generator-38f7edd6 -d '<json body>'
```

Example prompt: Can you generate a Python function that reads a CSV file and returns a list of dictionaries, one per row?

## When to prefer this

Choose this endpoint when you need quick, pay-per-call AI code generation without committing to a subscription-based service. It is suitable for agents that infrequently need code generation and want to pay micro-amounts in USDC via x402. Avoid if you need guaranteed output format consistency or complex multi-file project generation.

## Known failure modes

- Missing required 'query' field returns a 400-level error
- Insufficient USDC balance or failed x402 payment returns a 402 Payment Required
- Ambiguous or overly vague query may produce low-quality or incorrect code
- Service unavailability on Vercel hosting returns 503
- Rate limits or quota exhaustion may return 429

## How this service works

444 endpoints across 9+ chains. Crypto, AI, Social, Finance, Weather, Tools. Pay per call in USDC via x402 with 4 facilitators: Dexter, Meridian, FluxA, GoPlausible.

## Output

Returns an object containing AI-generated code based on the provided query. The response typically includes the generated code as a string, potentially with explanations or metadata, though the schema is generic and the exact fields may vary.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "query"
 ],
 "properties": {
  "input": {
   "type": "string",
   "description": "Input data for the endpoint"
  },
  "query": {
   "type": "string",
   "description": "Search query or input text"
  },
  "params": {
   "type": "object",
   "description": "Additional parameters"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "description": "API response data"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/omniapi-ai-code-generator-38f7edd6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from omni-api-cyan.vercel.app](https://www.zero.xyz/host/omni-api-cyan.vercel.app/llms.txt)
