Publish an endpoint
This guide walks through creating, publishing, inspecting, updating, and unpublishing API Gateway endpoints.
Prerequisites
- Access to a Crusoe AI Platform project.
- Project administrator role is required to publish, modify, or delete endpoints.
Set API credentials in your environment:
export CAI_API="https://api.codyhill.dev"
export CAI_PROJECT="<your-project-id>"
export CAI_TOKEN="<your-api-key-or-session-token>"
1. Publish an endpoint
Publishing creates a public URL routing external traffic to your target workload.
- platformctl
- curl
- Console UI
platformctl gateway publish agent/research-buddy
Output:
url: https://research-buddy-jxszd4.apps.codyhill.dev
name: research-buddy
points at: agent research-buddy
access: open to anyone
state: ready
Publishing with flags:
platformctl gateway publish agent/research-buddy \
--name support-api \
--auth apikey \
--rate-limit 100/minute
Publishing via API involves creating the endpoint and publishing it:
Step 1: Create endpoint metadata
curl -sS -X POST "$CAI_API/v1/projects/$CAI_PROJECT/gateway/endpoints" \
-H "Authorization: Bearer $CAI_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"name": "support-api", "target": {"kind": "agent", "name": "research-buddy"}}'
Step 2: Publish endpoint
curl -sS -X POST "$CAI_API/v1/projects/$CAI_PROJECT/gateway/endpoints/support-api/publish" \
-H "Authorization: Bearer $CAI_TOKEN"
Expected response (202 Accepted):
{
"endpoint": {
"name": "support-api",
"url": "https://support-api-jxszd4.apps.codyhill.dev",
"published": true,
"state": "ready",
"ready": true
}
}
- Open the Crusoe Console and select your project.
- Navigate to Networking → Endpoints.
- Click Publish Endpoint.
- Select the target resource type (e.g. Agent) and resource name (
research-buddy). - Choose an endpoint name (
support-api). - Click Publish.
2. Inspect active endpoints
View the status, public URL, and configuration of active endpoints.
- platformctl
- curl
- Console UI
List all endpoints in your project:
platformctl gateway endpoint list
Get detailed status for a single endpoint:
platformctl gateway endpoint get support-api
curl -sS -H "Authorization: Bearer $CAI_TOKEN" \
"$CAI_API/v1/projects/$CAI_PROJECT/gateway/endpoints/support-api"
Go to Networking → Endpoints and click on support-api to view live traffic metrics, configuration, and status.
3. Update access settings
Modify security settings, rate limits, or IP allowlists on a live endpoint without downtime.
- platformctl
- curl
- Console UI
platformctl gateway endpoint update support-api \
--allow-cidr 203.0.113.0/24 \
--rate-limit 500/minute
To clear restrictions:
platformctl gateway endpoint update support-api --clear-allow-cidr --clear-rate-limit
curl -sS -X PATCH "$CAI_API/v1/projects/$CAI_PROJECT/gateway/endpoints/support-api" \
-H "Authorization: Bearer $CAI_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"ip_allowlist": ["203.0.113.0/24"], "rate_limit": {"requests": 500, "unit": "minute", "key": "client_ip"}}'
- Navigate to the endpoint's Access & Security tab.
- Click Edit next to Authentication, IP Allowlists, or Rate Limits.
- Save your changes.
4. Unpublish an endpoint
Unpublishing disables public access and takes the URL offline while reserving the address name and saving your key configurations.
- platformctl
- curl
- Console UI
platformctl gateway endpoint unpublish support-api
curl -sS -X POST "$CAI_API/v1/projects/$CAI_PROJECT/gateway/endpoints/support-api/unpublish" \
-H "Authorization: Bearer $CAI_TOKEN"
Click Unpublish on the endpoint overview page.
5. Delete an endpoint
Deleting permanently releases the public address name and removes associated API keys.
- platformctl
- curl
- Console UI
platformctl gateway endpoint delete support-api
curl -sS -X DELETE "$CAI_API/v1/projects/$CAI_PROJECT/gateway/endpoints/support-api" \
-H "Authorization: Bearer $CAI_TOKEN"
Click Delete Endpoint at the bottom of the endpoint overview page and confirm.
Next steps
- Authentication — Configure API keys or JWT identity verification.
- Custom domains — Attach custom domains with automated TLS certificates.
- Rate limits — Protect endpoints with request throttling.
- IP allowlists — Restrict access to specific IP ranges.