Skip to content
Go To Dashboard

Repositories

Create private git repositories hosted by Sapiom and backed by GitHub. Clone and push immediately using your Sapiom API key as the git password — no GitHub account, no SSH key setup.

Reach repositories from a step through the typed ctx.sapiom.repositories client (create, get, list, delete, attach) — sapiom_dev_orchestrations_check validates the call at author time. See Using Capabilities.

import { createFetch } from "@sapiom/fetch";
const sapiomFetch = createFetch({
apiKey: process.env.SAPIOM_API_KEY,
agentName: "my-agent",
});
const baseUrl = "https://git.services.sapiom.ai";
// 1. Create a private repository — one-time $0.01 charge
const createRes = await sapiomFetch(`${baseUrl}/v1/git/repositories`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ slug: "my-agent-repo" }),
});
const { slug, cloneUrl } = await createRes.json();
// 2. Clone using your API key as the git password (username is ignored)
// git clone https://x:<SAPIOM_API_KEY>@git.services.sapiom.ai/...
console.log(`Clone with: git clone ${cloneUrl}`);

To push an existing local repo to a newly created Sapiom repository:

Terminal window
# Add the remote (username is ignored — use any value such as "x")
git remote add origin https://x:${SAPIOM_API_KEY}@git.services.sapiom.ai/<tenant>/<slug>
# Push
git push -u origin main

Repositories are Sapiom-hosted and GitHub-backed. When you create a repository, Sapiom provisions a private GitHub repository under a Sapiom-managed GitHub App installation. The clone URL is proxied through Sapiom’s git service — you authenticate with your Sapiom API key as the git password; the username field is ignored.

Creating a repository carries a one-time $0.01 fee (deducted from your prepaid balance via x402). Listing, reading, and deleting repositories are free — they’re identified operations that don’t require a micropayment.

Powered by GitHub (private repos under a Sapiom-managed GitHub App). Repositories are provisioned via GitHubAppService and stored under Sapiom’s managed GitHub organization.

Base URL: https://git.services.sapiom.ai

MethodPathDescriptionPricing
POST/v1/git/repositoriesCreate a new private repository$0.01 (one-time)
GET/v1/git/repositoriesList your repositoriesFree
GET/v1/git/repositories/:slugGet a repository by slugFree
DELETE/v1/git/repositories/:slugDelete a repositoryFree

Endpoint: POST https://git.services.sapiom.ai/v1/git/repositories

Creates a new private git repository. Returns the clone URL and authentication guidance. A $0.01 one-time fee is charged at creation via the x402 payment guard — ensure your Sapiom balance is funded.

ParameterTypeRequiredDescription
slugstringYesRepository name: lowercase letters, digits, and dashes; unique within your account. e.g. "billing-bot"
{ "slug": "billing-bot" }
{
"tenantId": "tenant_abc123",
"slug": "billing-bot",
"cloneUrl": "https://git.services.sapiom.ai/...",
"auth": {
"scheme": "basic",
"username": "(ignored)",
"password": "<your-sapiom-api-key>",
"example": "git clone https://x:<SAPIOM_API_KEY>@git.services.sapiom.ai/..."
}
}

Endpoint: GET https://git.services.sapiom.ai/v1/git/repositories

Returns all repositories for the calling tenant — slug, clone URL, status, and creation timestamp. Free.

{
"repositories": [
{
"slug": "billing-bot",
"cloneUrl": "https://git.services.sapiom.ai/...",
"status": "active",
"createdAt": "2026-06-25T04:00:00.000Z"
}
]
}

Endpoint: GET https://git.services.sapiom.ai/v1/git/repositories/:slug

Returns metadata for a single repository by its slug. Free.

{
"slug": "billing-bot",
"cloneUrl": "https://git.services.sapiom.ai/...",
"status": "active",
"createdAt": "2026-06-25T04:00:00.000Z"
}

Endpoint: DELETE https://git.services.sapiom.ai/v1/git/repositories/:slug

Permanently deletes the repository and its upstream GitHub backing. This action is irreversible. Free.

Returns 204 No Content on success.


CodeDescription
400Invalid request — e.g. malformed slug or slug already in use
402Payment or identity required — the git gateway uses @X402Payment(IdentityOrPaymentResolver) on all routes. For list/get/delete, this means a missing or invalid Sapiom API key triggers an x402 payment challenge (HTTP 402), not 401. For create, an insufficient balance also produces 402. Ensure your SDK is configured with a valid API key and, for create, that your balance covers the $0.01 fee.
404Repository not found
LimitValue
Max repositories per tenant100
OperationPrice
Create repository$0.01 (one-time, per repo)
List repositoriesFree
Get repositoryFree
Delete repositoryFree

Repository creation debits $0.01 from your prepaid Sapiom balance via the x402 payment guard. If your balance is insufficient (or if no valid identity is provided), the gateway returns 402 (an x402 payment challenge). List, get, and delete are free for an identified caller — a valid Sapiom API key is sufficient.