Call it
curl https://api.peume.com/v1/call/files-of-a-github-repository \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"max_chars": 100000,
"max_files": 50,
"path": "example/__init__.py",
"ref": "main",
"url": "https://github.com/unclecode/example/blob/main/README.md"
}
}'const res = await fetch("https://api.peume.com/v1/call/files-of-a-github-repository", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"max_chars": 100000,
"max_files": 50,
"path": "example/__init__.py",
"ref": "main",
"url": "https://github.com/unclecode/example/blob/main/README.md"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/files-of-a-github-repository",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"max_chars": 100000,
"max_files": 50,
"path": "example/__init__.py",
"ref": "main",
"url": "https://github.com/unclecode/example/blob/main/README.md"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: files-of-a-github-repository.
Parameters
max_charsintegercuts each file's text at this many characters; default 100000
Example: 100000
max_filesintegercaps the files read from a folder; default 50
Example: 50
pathstringreplaces the URL's path
Example: example/__init__.py
refstringreplaces the URL's branch, tag or commit
Example: main
urlRequiredstringa github.com /blob/ or /tree/ URL, a raw URL, or owner/name for the root folder
Example: https://github.com/unclecode/example/blob/main/README.md
