curl 'https://agent.blackbox.ai/api/v1/git/config' \
-H 'Authorization: Bearer YOUR_API_KEY'
const API_KEY = "YOUR_API_KEY";
const response = await fetch(
"https://agent.blackbox.ai/api/v1/git/config",
{ headers: { Authorization: `Bearer ${API_KEY}` } }
);
const data = await response.json();
console.log(data.connected ? `Connected as ${data.login}` : "Not connected");
import requests
API_KEY = "YOUR_API_KEY"
response = requests.get(
"https://agent.blackbox.ai/api/v1/git/config",
headers={"Authorization": f"Bearer {API_KEY}"},
)
data = response.json()
print(f"Connected: {data['connected']}")
if data["connected"]:
print(f"Login: {data['login']}")
package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
apiKey := "YOUR_API_KEY"
url := "https://agent.blackbox.ai/api/v1/git/config"
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("Connected: %v\n", result["connected"])
}
{
"connected": true,
"login": "octocat",
"name": "The Octocat",
"email": "octocat@github.com",
"avatarUrl": "https://avatars.githubusercontent.com/u/583231",
"scopes": "repo,user",
"tokenCreatedAt": "2026-05-01T12:00:00.000Z"
}
{
"connected": false
}
GitHub Integration
Get GitHub Config
Returns the GitHub account linked to your BLACKBOX API key, or { connected: false } if no token is stored.
GET
/
api
/
v1
/
git
/
config
curl 'https://agent.blackbox.ai/api/v1/git/config' \
-H 'Authorization: Bearer YOUR_API_KEY'
const API_KEY = "YOUR_API_KEY";
const response = await fetch(
"https://agent.blackbox.ai/api/v1/git/config",
{ headers: { Authorization: `Bearer ${API_KEY}` } }
);
const data = await response.json();
console.log(data.connected ? `Connected as ${data.login}` : "Not connected");
import requests
API_KEY = "YOUR_API_KEY"
response = requests.get(
"https://agent.blackbox.ai/api/v1/git/config",
headers={"Authorization": f"Bearer {API_KEY}"},
)
data = response.json()
print(f"Connected: {data['connected']}")
if data["connected"]:
print(f"Login: {data['login']}")
package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
apiKey := "YOUR_API_KEY"
url := "https://agent.blackbox.ai/api/v1/git/config"
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("Connected: %v\n", result["connected"])
}
{
"connected": true,
"login": "octocat",
"name": "The Octocat",
"email": "octocat@github.com",
"avatarUrl": "https://avatars.githubusercontent.com/u/583231",
"scopes": "repo,user",
"tokenCreatedAt": "2026-05-01T12:00:00.000Z"
}
{
"connected": false
}
This endpoint returns the GitHub account connected to your BLACKBOX API key. Use it to check which GitHub user is linked before creating tasks that work with repositories.
This endpoint requires a Pro subscription.
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_b41b647ffbfed27f616560Response Fields
boolean
true if a valid GitHub token is stored, false otherwise.string
GitHub username. Present when
connected: true.string | null
Display name of the GitHub user.
string | null
Primary email of the GitHub user.
string
GitHub avatar URL.
string
OAuth scopes granted by the token (e.g.
"repo,user").string | null
ISO 8601 timestamp when the token was stored.
null if not recorded.curl 'https://agent.blackbox.ai/api/v1/git/config' \
-H 'Authorization: Bearer YOUR_API_KEY'
const API_KEY = "YOUR_API_KEY";
const response = await fetch(
"https://agent.blackbox.ai/api/v1/git/config",
{ headers: { Authorization: `Bearer ${API_KEY}` } }
);
const data = await response.json();
console.log(data.connected ? `Connected as ${data.login}` : "Not connected");
import requests
API_KEY = "YOUR_API_KEY"
response = requests.get(
"https://agent.blackbox.ai/api/v1/git/config",
headers={"Authorization": f"Bearer {API_KEY}"},
)
data = response.json()
print(f"Connected: {data['connected']}")
if data["connected"]:
print(f"Login: {data['login']}")
package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
apiKey := "YOUR_API_KEY"
url := "https://agent.blackbox.ai/api/v1/git/config"
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("Connected: %v\n", result["connected"])
}
{
"connected": true,
"login": "octocat",
"name": "The Octocat",
"email": "octocat@github.com",
"avatarUrl": "https://avatars.githubusercontent.com/u/583231",
"scopes": "repo,user",
"tokenCreatedAt": "2026-05-01T12:00:00.000Z"
}
{
"connected": false
}
Error Codes
| Status Code | Error | Description |
|---|---|---|
| 200 | Success | Config returned |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | Pro subscription required |
| 500 | Internal Server Error | Failed to retrieve config |