curl 'https://agent.blackbox.ai/api/v1/git/repos' \
-H 'Authorization: Bearer YOUR_API_KEY'
curl 'https://agent.blackbox.ai/api/v1/git/repos?include_orgs=false' \
-H 'Authorization: Bearer YOUR_API_KEY'
const API_KEY = "YOUR_API_KEY";
const response = await fetch(
"https://agent.blackbox.ai/api/v1/git/repos",
{ headers: { Authorization: `Bearer ${API_KEY}` } }
);
const data = await response.json();
console.log(`Total repos: ${data.total}`);
data.repos.forEach(r => console.log(`${r.full_name} (${r.private ? "private" : "public"})`));
import requests
API_KEY = "YOUR_API_KEY"
response = requests.get(
"https://agent.blackbox.ai/api/v1/git/repos",
headers={"Authorization": f"Bearer {API_KEY}"},
)
data = response.json()
print(f"Total repos: {data['total']}")
for repo in data["repos"]:
visibility = "private" if repo["private"] else "public"
print(f"{repo['full_name']} ({visibility})")
package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
apiKey := "YOUR_API_KEY"
url := "https://agent.blackbox.ai/api/v1/git/repos"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "Bearer "+apiKey)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result map[string]interface{}
json.Unmarshal(body, &result)
fmt.Printf("Total repos: %v\n", result["total"])
}
{
"repos": [
{
"id": 123456789,
"name": "my-app",
"full_name": "octocat/my-app",
"private": false,
"html_url": "https://github.com/octocat/my-app",
"description": "My awesome application",
"fork": false,
"default_branch": "main",
"updated_at": "2026-05-20T10:00:00Z"
},
{
"id": 987654321,
"name": "private-api",
"full_name": "my-org/private-api",
"private": true,
"html_url": "https://github.com/my-org/private-api",
"description": "Internal API service",
"fork": false,
"default_branch": "main",
"updated_at": "2026-05-19T08:30:00Z"
}
],
"total": 2
}
{
"error": "No GitHub token found. Connect your GitHub account first."
}
GitHub Integration
List Repositories
List all GitHub repositories accessible to your connected account, including personal and organization repositories.
GET
/
api
/
v1
/
git
/
repos
curl 'https://agent.blackbox.ai/api/v1/git/repos' \
-H 'Authorization: Bearer YOUR_API_KEY'
curl 'https://agent.blackbox.ai/api/v1/git/repos?include_orgs=false' \
-H 'Authorization: Bearer YOUR_API_KEY'
const API_KEY = "YOUR_API_KEY";
const response = await fetch(
"https://agent.blackbox.ai/api/v1/git/repos",
{ headers: { Authorization: `Bearer ${API_KEY}` } }
);
const data = await response.json();
console.log(`Total repos: ${data.total}`);
data.repos.forEach(r => console.log(`${r.full_name} (${r.private ? "private" : "public"})`));
import requests
API_KEY = "YOUR_API_KEY"
response = requests.get(
"https://agent.blackbox.ai/api/v1/git/repos",
headers={"Authorization": f"Bearer {API_KEY}"},
)
data = response.json()
print(f"Total repos: {data['total']}")
for repo in data["repos"]:
visibility = "private" if repo["private"] else "public"
print(f"{repo['full_name']} ({visibility})")
package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
apiKey := "YOUR_API_KEY"
url := "https://agent.blackbox.ai/api/v1/git/repos"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "Bearer "+apiKey)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result map[string]interface{}
json.Unmarshal(body, &result)
fmt.Printf("Total repos: %v\n", result["total"])
}
{
"repos": [
{
"id": 123456789,
"name": "my-app",
"full_name": "octocat/my-app",
"private": false,
"html_url": "https://github.com/octocat/my-app",
"description": "My awesome application",
"fork": false,
"default_branch": "main",
"updated_at": "2026-05-20T10:00:00Z"
},
{
"id": 987654321,
"name": "private-api",
"full_name": "my-org/private-api",
"private": true,
"html_url": "https://github.com/my-org/private-api",
"description": "Internal API service",
"fork": false,
"default_branch": "main",
"updated_at": "2026-05-19T08:30:00Z"
}
],
"total": 2
}
{
"error": "No GitHub token found. Connect your GitHub account first."
}
This endpoint returns all GitHub repositories accessible to the connected GitHub account. It fetches both personal repositories and, optionally, repositories from all organizations the user belongs to. Results are deduplicated by
full_name.
This endpoint requires a Pro subscription and a connected GitHub account. Connect your GitHub account via
POST /api/v1/git/config first.Authentication
To use this API, you need a BLACKBOX API Key. Follow these steps to get your API key:- Go to app.blackbox.ai/agent-api and click Get an API Key (requires a Pro subscription)
- Once provisioning completes, you will be redirected to your Dashboard
- From the Dashboard, create an API key to use with all Agent API requests
sk-xxxxxxxxxxxxxxxxxxxxxx
Headers
string
required
API Key of the form
Bearer <api_key>.Example: Bearer sk_b41b647ffbfed27f616560Query Parameters
boolean
default:"true"
Whether to include repositories from organizations the user belongs to.Default:
trueExample: include_orgs=falseResponse Fields
array
Array of repository objects.
Show Repository Object
Show Repository Object
number
GitHub repository ID.
string
Repository name (without owner prefix).
string
Full repository name in
owner/repo format.boolean
Whether the repository is private.
string
URL to the repository on GitHub.
string | null
Repository description.
boolean
Whether the repository is a fork.
string
The repository’s default branch (e.g.
"main").string
ISO 8601 timestamp of the last update.
number
Total number of repositories returned.
curl 'https://agent.blackbox.ai/api/v1/git/repos' \
-H 'Authorization: Bearer YOUR_API_KEY'
curl 'https://agent.blackbox.ai/api/v1/git/repos?include_orgs=false' \
-H 'Authorization: Bearer YOUR_API_KEY'
const API_KEY = "YOUR_API_KEY";
const response = await fetch(
"https://agent.blackbox.ai/api/v1/git/repos",
{ headers: { Authorization: `Bearer ${API_KEY}` } }
);
const data = await response.json();
console.log(`Total repos: ${data.total}`);
data.repos.forEach(r => console.log(`${r.full_name} (${r.private ? "private" : "public"})`));
import requests
API_KEY = "YOUR_API_KEY"
response = requests.get(
"https://agent.blackbox.ai/api/v1/git/repos",
headers={"Authorization": f"Bearer {API_KEY}"},
)
data = response.json()
print(f"Total repos: {data['total']}")
for repo in data["repos"]:
visibility = "private" if repo["private"] else "public"
print(f"{repo['full_name']} ({visibility})")
package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
apiKey := "YOUR_API_KEY"
url := "https://agent.blackbox.ai/api/v1/git/repos"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "Bearer "+apiKey)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result map[string]interface{}
json.Unmarshal(body, &result)
fmt.Printf("Total repos: %v\n", result["total"])
}
{
"repos": [
{
"id": 123456789,
"name": "my-app",
"full_name": "octocat/my-app",
"private": false,
"html_url": "https://github.com/octocat/my-app",
"description": "My awesome application",
"fork": false,
"default_branch": "main",
"updated_at": "2026-05-20T10:00:00Z"
},
{
"id": 987654321,
"name": "private-api",
"full_name": "my-org/private-api",
"private": true,
"html_url": "https://github.com/my-org/private-api",
"description": "Internal API service",
"fork": false,
"default_branch": "main",
"updated_at": "2026-05-19T08:30:00Z"
}
],
"total": 2
}
{
"error": "No GitHub token found. Connect your GitHub account first."
}
Error Codes
| Status Code | Error | Description |
|---|---|---|
| 200 | Success | Repository list returned |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | Pro subscription required or no GitHub token stored |
| 500 | Internal Server Error | Failed to fetch repositories from GitHub |