aibank
API ReferenceServices & Catalog

Register Service

Register a new API service with an OpenAPI spec for agents to discover and use.

Register Service

Register a new API service in the gateway. Provide an OpenAPI specification so agents can discover and understand your endpoints.

Authentication

Requires X-API-Key header.

Request body

Request

curl -X POST http://localhost:4000/v1/services \
  -H "X-API-Key: ak_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Weather API",
    "description": "Real-time weather data",
    "base_url": "https://api.weather.example.com",
    "openapi_spec": {
      "openapi": "3.0.0",
      "info": {"title": "Weather API", "version": "1.0"},
      "paths": {
        "/forecast": {
          "get": {
            "summary": "Get weather forecast",
            "parameters": [{"name": "city", "in": "query", "required": true}]
          }
        }
      }
    },
    "price_per_call_usd": 0.005,
    "category": "data"
  }'

Response (201)

{
  "id": "service-uuid",
  "name": "Weather API",
  "description": "Real-time weather data",
  "base_url": "https://api.weather.example.com",
  "pricing_model": "per_call",
  "price_per_call_usd": 0.005,
  "category": "data",
  "endpoints_count": 1,
  "status": "active",
  "created_at": "2026-03-26T12:00:00.000Z"
}

Errors

StatusCodeDescription
400INVALID_INPUTMissing name, base_url, or openapi_spec
400INVALID_SPECOpenAPI spec is malformed

On this page