# PyPI Package Preflight Check

> PyPI Package Preflight Check is a paid API for AI agents from base-agent-preflight.bytoken2023.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Checks a PyPI package's metadata, release age, yanked status, Python requirements, dependencies, license, and known OSV vulnerabilities.

## Facts

- Endpoint: GET https://base-agent-preflight.bytoken2023.workers.dev/v1/x402/software/pypi-package-preflight
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pypi-package-preflight-check-1a2ff108
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_a9j-F5Zfs7vUYHKFrigO8

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 pypi-package-preflight-check-1a2ff108
```

Example prompt: Before I add it to my project, can you run a preflight check on the PyPI package 'requests' version 2.31.0 — I want to know if it has any OSV vulnerabilities, whether it's been yanked, what license it uses, and what Python versions it supports?

## When to prefer this

Use this endpoint when you need a comprehensive, machine-readable preflight safety and metadata check for a specific PyPI package before installing or depending on it — especially when you want vulnerability data (OSV), license compliance, yanked status, and Python compatibility all in one call. Prefer this over manual PyPI browsing or separate OSV queries when automating dependency auditing in CI/CD pipelines or agent-driven software workflows.

## Known failure modes

- Package not found on PyPI — returns error if the package name is misspelled or does not exist
- Version not found — if a specific version string is invalid or not published, returns an error
- OSV lookup failure — vulnerability data may be unavailable if OSV service is unreachable
- Invalid package name pattern — returns validation error if name does not match PyPI naming rules
- Network timeout — Cloudflare Worker may time out fetching upstream PyPI or OSV data

## How this service works

Machine-payable service intelligence for discovering, verifying, and monitoring identity, risk, authorization, execution-preflight, and evidence APIs before autonomous agents spend.

## Output

Returns structured assessment including package metadata (name, version, release date, age), yanked/deprecation status, supported Python version requirements, declared dependencies, license type, and any known OSV security vulnerabilities linked to that package version.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "package"
     ],
     "properties": {
      "package": {
       "type": "string",
       "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,198}[A-Za-z0-9])?$",
       "description": "PyPI project name."
      },
      "version": {
       "type": "string",
       "pattern": "^(?:latest|[A-Za-z0-9][A-Za-z0-9._+!-]{0,99})$",
       "description": "Exact PyPI version or latest. Defaults to latest."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "network": {
       "type": "string"
      },
      "product": {
       "type": "string"
      },
      "activity": {
       "type": "object"
      },
      "identity": {
       "type": "object"
      },
      "assessment": {
       "type": "object"
      },
      "provenance": {
       "type": "object"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "network": "eip155:8453",
  "product": "pypi-package-preflight",
  "assessment": {
   "flags": [],
   "risk_level": "low",
   "risk_score": 0
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pypi-package-preflight-check-1a2ff108/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from base-agent-preflight.bytoken2023.workers.dev](https://www.zero.xyz/host/base-agent-preflight.bytoken2023.workers.dev/llms.txt)
