Disclaimer
This is a reverse-engineered implementation. Use at your own risk. Abuse may result in GitHub account restrictions. Not affiliated with GitHub or Microsoft.
1
Authenticate
Generate a device code to authorize with GitHub. This retrieves your Copilot-enabled token.
2
Your API Token
This JWT is valid for 24 hours. Keep it secret.
3
Test Connectivity
model: gpt-4.1API Base URL: ...
4
Integration
Use your token with standard OpenAI-compatible clients.
Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
base_url="...",
api_key="YOUR_TOKEN"
)
response = client.chat.completions.create(
model="gpt-4.1",
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)
Bash / cURL
curl -X POST .../chat/completions \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4.1",
"messages": [{"role": "user", "content": "Hi"}]
}'