Documentation AI instructions
For AI coding tools

Finish the code, then push it here.

Give this page and an agent token to any tool that can make HTTP requests. It needs only two API calls.

Machine-readable JSON
01

Copy this instruction into the AI tool

You can push completed code through AI Git Gateway.

Gateway API: https://git.usman.info/api/v1
Authentication: Authorization: Bearer <AI_GIT_TOKEN>

1. Call GET https://git.usman.info/api/v1/projects to find the allowed project slug, repository, default branch, and branch policy.
2. Finish and verify the requested code before pushing.
3. Call POST https://git.usman.info/api/v1/push with project, branch, commit_message, and every changed file.
4. For text files use {"path":"...","content":"..."}.
5. For binary files use {"path":"...","content_base64":"..."}.
6. To delete a file use {"path":"...","delete":true}.
7. Never reveal, print, log, or commit the AI_GIT_TOKEN.
8. Do not retry a conflict blindly. Report the error to the user.
9. Return the commit_url after success.
10. Remind the user to revoke this agent token after the job.
02

Discover allowed projects

curl https://git.usman.info/api/v1/projects \
  -H "Authorization: Bearer $AI_GIT_TOKEN"

The response contains only projects accessible to that token.

03

Push completed files

curl -X POST https://git.usman.info/api/v1/push \
  -H "Authorization: Bearer $AI_GIT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "project": "my-project",
    "branch": "main",
    "commit_message": "Complete requested feature",
    "files": [
      {"path": "app/main.py", "content": "print(\"ready\")\n"},
      {"path": "old_file.py", "delete": true}
    ]
  }'
04

Delivery rules

Completed files only

The gateway does not execute code or shell commands.

Non-force pushes

GitHub rejects protected branches and conflicting updates.

Keep the token secret

Never place it in source files, logs, prompts, or commits.

Revoke after use

The administrator should remove access when the task ends.