osmRouterosmRouter

REST API

Manage tunnels, domains, tokens, and usage over HTTP. Authenticate with your agent token.

The control-plane API lets you read and manage your account programmatically. The base URL is https://api.osmrouter.com.

Authentication

Send your agent token as a Bearer token:

curl https://api.osmrouter.com/v1/usage \
  -H "Authorization: Bearer $OSM_TOKEN"

Create tokens under Tokens in the dashboard. The same token authenticates the CLI, the SDK, and the API.

Endpoints

MethodPathDescription
GET/v1/meThe current account (id, email, name, plan).
GET/v1/usageCurrent plan, limits, and usage (domains, tunnels, bandwidth).
GET/v1/usage/historyDaily usage rollups over time.
GET/v1/tunnelsTunnels on your account and their status.
DELETE/v1/tunnels/:idRelease a tunnel (free its name or port).
GET/v1/requestsRecent requests captured by the Traffic Inspector.
GET/v1/domainsCustom domains and their verification state.
POST/v1/domainsAdd a domain (returns the DNS TXT record to publish).
POST/v1/domains/:id/verifyRe-check a domain's DNS TXT record.
DELETE/v1/domains/:idRemove a domain.
GET/v1/keysList agent tokens (metadata only).
POST/v1/keysCreate an agent token (returns the secret once).
DELETE/v1/keys/:idRevoke an agent token.

Examples

Read current usage against your plan:

curl https://api.osmrouter.com/v1/usage \
  -H "Authorization: Bearer $OSM_TOKEN"
{
	"plan": "free",
	"limits": { "domains": 2, "tunnels": 10, "bandwidthBytes": 53687091200 },
	"used": { "domains": 0, "tunnels": 1, "bandwidthBytes": 846 }
}

List live tunnels:

curl https://api.osmrouter.com/v1/tunnels \
  -H "Authorization: Bearer $OSM_TOKEN"

Read recent inspector requests:

curl https://api.osmrouter.com/v1/requests \
  -H "Authorization: Bearer $OSM_TOKEN"
{
	"requests": [
		{
			"method": "GET",
			"path": "/",
			"status": 200,
			"durationMs": 234,
			"bytes": 28,
			"ip": "203.0.113.7",
			"userAgent": "curl/8.7.1",
			"proto": "HTTP/2.0",
			"host": "my-app.osmrouter.com"
		}
	]
}

Trigger a domain re-check:

curl -X POST https://api.osmrouter.com/v1/domains/<id>/verify \
  -H "Authorization: Bearer $OSM_TOKEN"

Errors

Requests without a valid token return 401:

{ "error": "unauthorized" }

Next steps