# GitHub Repository File Fetcher

> GitHub Repository File Fetcher is a paid API for AI agents from sovereign-x402-zeta.vercel.app, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-13).

Fetches the raw contents of a file from a GitHub repository at a specified ref (branch, tag, or commit).

## Facts

- Endpoint: POST https://sovereign-x402-zeta.vercel.app/api/v1/repo/github/file
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/github-repository-file-fetcher-e1ae5490
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lWmoOn_UZ2-i_rEjV1C-n

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 github-repository-file-fetcher-e1ae5490 -d '<json body>'
```

Example prompt: Can you fetch the contents of the file `src/config.json` from the `main` branch of the GitHub repo `octocat/Hello-World`?

## When to prefer this

Use this endpoint when an agent needs to programmatically read a specific file from a GitHub repository at a particular ref (branch, tag, or commit), especially in automated workflows that need to inspect source code, configuration files, or documentation without cloning the entire repository.

## Known failure modes

- File not found at the given path or ref — returns 404-style error
- Invalid repository name or owner — repository does not exist or is private without credentials
- Invalid or non-existent ref (branch, tag, or commit SHA) — returns error indicating ref not found
- Rate limiting from GitHub API — returns error if too many requests are made
- Network or service unavailability — upstream GitHub API unreachable

## How this service works

Fetch a file's contents from a GitHub repository at a given ref.

## Output

Returns the raw contents of the requested file from the GitHub repository at the specified ref, which may include text or binary file data along with any associated metadata.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "properties": {},
     "additionalProperties": true
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/github-repository-file-fetcher-e1ae5490/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from sovereign-x402-zeta.vercel.app](https://www.zero.xyz/host/sovereign-x402-zeta.vercel.app/llms.txt)
