Skip to main content
POST
Create a container service definition

Authorizations

Authorization
string
header
required

User session JWT (Bearer ). Must be paired with the X-Team-ID request header on team-scoped endpoints so the server knows which team's resources to operate on.

Headers

X-Team-ID
string<uuid>

UUID of the team to scope the request to. Used by dual-auth endpoints (runtime + scoped management):

  • JWT callers MUST send it — a user may belong to multiple teams and the runtime cannot otherwise know which one to operate on. Missing header → 400.
  • Credential callers (sk-, dk-) can omit it because the team is derived from the credential row itself. Any value sent is ignored.
Example:

"019abc12-4567-7890-abcd-ef1234567891"

Body

application/json

Create a container service definition. Two service types are supported:

  • deployed (default) — the platform pulls docker_image and runs it on the team's agents. docker_image is required.
  • external — the team's existing HTTP service is fronted by Cyberun. external_url is required and must be https://. The agent makes outbound calls to it via its existing tunnel. See ADR-0007.

service_type is immutable after creation; recreate the service to switch.

service_slug
string
required

URL-safe slug for the service (3-100 chars, lowercase, hyphens)

Pattern: ^[a-z0-9][a-z0-9-]{1,98}[a-z0-9]$
display_name
string
required
Maximum string length: 255
service_desc
string
service_type
enum<string>
default:deployed

How this service is hosted. See ADR-0007 in the engineering docs.

Available options:
deployed,
external
docker_image
string

Docker image reference (e.g. vllm/vllm-openai:latest). Required when service_type=deployed.

external_url
string<uri>

Absolute https:// URL of the externally-hosted service. Required when service_type=external.

Maximum string length: 2048
Pattern: ^https://
external_auth_credential_id
string<uuid>

Optional credential vault reference. When set, the agent attaches the resolved credential as an Authorization header on outbound requests. Only meaningful when service_type=external.

exposed_port
integer
default:8080
Required range: 1 <= x <= 65535
health_path
string
default:/health
env_config
object[]
volume_config
object[]
required_labels
string[]

Agent labels required to deploy this service

gpu_count
integer
default:0

GPU count: -1=all GPUs, 0=none (default), N=specific count

replica_count
integer
default:1
Required range: 1 <= x <= 10
usage_prompt
string

Optional natural-language description aimed at AI agents discovering this service through MCP. Example: "This is ollama. POST /api/generate with {model, prompt}. Available models: llama3, qwen2." Readable by anyone who can list/read services in the team — do not put secrets here.

openapi_url
string

Optional path served by the container where an OpenAPI document lives (e.g. "/openapi.json" for FastAPI). Lets AI agents fetch a machine-readable schema before invoking.

Maximum string length: 500

Response

Service created

id
string<uuid>
required

UUID of the created or updated resource.

Example:

"019abc12-3456-7890-abcd-ef1234567890"