Skip to main content

Ship a change end to end

Find the workspace, then the project.

bash
curl -s https://app.kosuke.ai/api/organizations \
-H "Authorization: Bearer $KOSUKE_API_KEY"

curl -s https://app.kosuke.ai/api/projects \
-H "Authorization: Bearer $KOSUKE_API_KEY"

Open a session with the first message. This creates the branch, starts the sandbox and queues the first turn.

bash
curl -s -X POST \
"https://app.kosuke.ai/api/projects/$PROJECT_ID/chat-sessions" \
-H "Authorization: Bearer $KOSUKE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Add rate limiting to the public search endpoint, 60 requests per minute per IP.",
"model": "anthropic:opus__high"
}'

The response carries session.id and chatJobId. Poll the job until it leaves pending and running.

bash
curl -s "https://app.kosuke.ai/api/projects/$PROJECT_ID/chat-sessions/$SESSION_ID/jobs/chat/$CHAT_JOB_ID" \
-H "Authorization: Bearer $KOSUKE_API_KEY"

Read what changed.

bash
curl -s "https://app.kosuke.ai/api/projects/$PROJECT_ID/chat-sessions/$SESSION_ID/preview/diff/files" \
-H "Authorization: Bearer $KOSUKE_API_KEY"

Ask for more, in the same session. The reply tells you whether it became its own turn or was folded into the one still running.

bash
curl -s -X POST \
"https://app.kosuke.ai/api/projects/$PROJECT_ID/chat-sessions/$SESSION_ID/jobs/chat" \
-H "Authorization: Bearer $KOSUKE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content": "Use a sliding window instead of a fixed one."}'

Submit, then poll the submit job until completed.

bash
curl -s -X POST \
"https://app.kosuke.ai/api/projects/$PROJECT_ID/chat-sessions/$SESSION_ID/submit" \
-H "Authorization: Bearer $KOSUKE_API_KEY"

The session's detail endpoint carries prUrl once the pull request is open.