# fly.ai Forecast Pay-Per-Request API

> fly.ai Forecast Pay-Per-Request API is a paid API for AI agents from flyai-x402.fly.dev, paid per call via x402, $0.03/call, status unknown (last checked 2026-10-11).

Returns a single AI-generated forecast answer for a given reference, paid per-call via x402 micropayment, with configurable horizon and confidence parameters.

## Facts

- Endpoint: GET https://flyai-x402.fly.dev/forecast/%7Bref%7D?utm_source=zero.xyz
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fly-ai-forecast-pay-per-request-api-4aa174fc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oTO1k3KviC4yWzbU7msOP

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 fly-ai-forecast-pay-per-request-api-4aa174fc
```

Example prompt: Get me a fly.ai forecast for reference ID 'stock-42' with a horizon of 7 and a confidence threshold of 0.85.

## When to prefer this

Choose this endpoint when you need a single, on-demand AI forecast answer for a specific reference and want to pay only for that one call via x402 micropayment (USDC). Ideal for agents that need occasional forecasts without a subscription, or for cost-controlled pipelines that pay per result. Use when you have a known reference ID and want to control forecast horizon and confidence.

## Known failure modes

- Payment not processed or insufficient USDC balance — 402 Payment Required response
- Invalid or unknown reference ID (ref) — may return an error or empty result
- Horizon value out of supported range — may return a computation error
- Confidence value outside 0–1 range — validation error
- Service downtime on fly.dev infrastructure — connection or 5xx error

## How this service works

Single answers, each paid on its own over x402. Guide: https://www.flyaiworld.com/x402-api.md

## Output

A single forecast answer for the specified reference, reflecting the requested time horizon and confidence parameters. The response is returned immediately after the x402 micropayment is processed; exact response fields are unspecified in the schema but expected to contain the forecast value or prediction output.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "horizon": {
   "type": "integer"
  },
  "confidence": {
   "type": "number"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fly-ai-forecast-pay-per-request-api-4aa174fc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from flyai-x402.fly.dev](https://www.zero.xyz/host/flyai-x402.fly.dev/llms.txt)
