API Keys
API key management for cloud instances
List Antfly Cloud management API keys
/organizations/{org_id}/cloud/api-keysList organization-scoped Antfly Cloud management API keys
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
Code Examples
curl -X GET "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/api-keys" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/api-keys", {
method: "GET",
headers: {
Authorization: "Bearer YOUR_TOKEN"
}
});
const data = await response.json();Responses
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"organization_id": "550e8400-e29b-41d4-a716-446655440000",
"created_by_user_id": "550e8400-e29b-41d4-a716-446655440000",
"cloud_instance_id": "550e8400-e29b-41d4-a716-446655440000",
"key_prefix": "antflydb_abc123",
"key_scope": "instance",
"key_prefix_type": "antflydb",
"name": "Production API Key",
"key_type": "read_only",
"status": "active",
"created_at": "2025-10-02T15:30:00Z",
"last_used_at": "2025-10-02T15:30:00Z",
"expires_at": "2025-10-02T15:30:00Z",
"quota_queries_per_month": 0,
"allowed_tables": [
"string"
],
"allowed_operations": [
"string"
],
"row_filter": {},
"grants": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"organization_id": "550e8400-e29b-41d4-a716-446655440000",
"cloud_instance_id": "550e8400-e29b-41d4-a716-446655440000",
"subject_type": "user",
"subject_id": "550e8400-e29b-41d4-a716-446655440000",
"table_name": "string",
"actions": [
"string"
],
"row_filter": {},
"row_filter_template": {},
"metadata": {},
"created_by": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2025-10-02T15:30:00Z",
"updated_at": "2025-10-02T15:30:00Z"
}
],
"management_scopes": [
"string"
],
"hosted_inference_limits": {
"allowed_models": [
"string"
],
"requests_per_minute": 0,
"tokens_per_minute": 0,
"concurrent_requests": 0,
"managed_spend_cents_per_day": 0,
"managed_spend_cents_per_month": 0
},
"browser_access": true,
"shared_inference": true
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}Create Antfly Cloud management API key
/organizations/{org_id}/cloud/api-keysCreate an organization-scoped antfly_cloud_* key for Antfly Cloud management API calls
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
Request Body
{
"name": "Antfly Cloud CLI",
"scopes": [
"string"
],
"expires_at": "2025-10-02T15:30:00Z",
"hosted_inference_limits": {
"allowed_models": [
"string"
],
"requests_per_minute": 0,
"tokens_per_minute": 0,
"concurrent_requests": 0,
"managed_spend_cents_per_day": 0,
"managed_spend_cents_per_month": 0
}
}
Code Examples
curl -X POST "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/api-keys" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Antfly Cloud CLI",
"scopes": [
"string"
],
"expires_at": "2025-10-02T15:30:00Z",
"hosted_inference_limits": {
"allowed_models": [
"string"
],
"requests_per_minute": 0,
"tokens_per_minute": 0,
"concurrent_requests": 0,
"managed_spend_cents_per_day": 0,
"managed_spend_cents_per_month": 0
}
}'const response = await fetch("https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/api-keys", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "Antfly Cloud CLI",
"scopes": [
"string"
],
"expires_at": "2025-10-02T15:30:00Z",
"hosted_inference_limits": {
"allowed_models": [
"string"
],
"requests_per_minute": 0,
"tokens_per_minute": 0,
"concurrent_requests": 0,
"managed_spend_cents_per_day": 0,
"managed_spend_cents_per_month": 0
}
})
});
const data = await response.json();Responses
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"key": "antflydb_abc123_sk_live_xxxxxxxxxxxxxxxxxxxxx",
"key_prefix": "antflydb_abc123",
"name": "string",
"key_type": "read_only",
"browser_access": true,
"shared_inference": true
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}Update Antfly Cloud management API key
/organizations/{org_id}/cloud/api-keys/{key_id}Update mutable settings for an organization-scoped antfly_cloud_* management API key
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
key_id | string | path | Yes | API key ID |
Request Body
{
"hosted_inference_limits": {
"allowed_models": [
"string"
],
"requests_per_minute": 0,
"tokens_per_minute": 0,
"concurrent_requests": 0,
"managed_spend_cents_per_day": 0,
"managed_spend_cents_per_month": 0
}
}
Code Examples
curl -X PATCH "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/api-keys/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"hosted_inference_limits": {
"allowed_models": [
"string"
],
"requests_per_minute": 0,
"tokens_per_minute": 0,
"concurrent_requests": 0,
"managed_spend_cents_per_day": 0,
"managed_spend_cents_per_month": 0
}
}'const response = await fetch("https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/api-keys/550e8400-e29b-41d4-a716-446655440000", {
method: "PATCH",
headers: {
Authorization: "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"hosted_inference_limits": {
"allowed_models": [
"string"
],
"requests_per_minute": 0,
"tokens_per_minute": 0,
"concurrent_requests": 0,
"managed_spend_cents_per_day": 0,
"managed_spend_cents_per_month": 0
}
})
});
const data = await response.json();Responses
{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}Revoke Antfly Cloud management API key
/organizations/{org_id}/cloud/api-keys/{key_id}Revoke an organization-scoped antfly_cloud_* management API key
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
key_id | string | path | Yes | API key ID |
Code Examples
curl -X DELETE "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/api-keys/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/api-keys/550e8400-e29b-41d4-a716-446655440000", {
method: "DELETE",
headers: {
Authorization: "Bearer YOUR_TOKEN"
}
});
const data = await response.json();Responses
{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}List cloud API keys
/organizations/{org_id}/cloud/instances/{instance_id}/api-keysList API keys for a cloud instance
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
instance_id | string | path | Yes | Cloud instance ID |
Code Examples
curl -X GET "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/instances/550e8400-e29b-41d4-a716-446655440000/api-keys" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/instances/550e8400-e29b-41d4-a716-446655440000/api-keys", {
method: "GET",
headers: {
Authorization: "Bearer YOUR_TOKEN"
}
});
const data = await response.json();Responses
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"organization_id": "550e8400-e29b-41d4-a716-446655440000",
"created_by_user_id": "550e8400-e29b-41d4-a716-446655440000",
"cloud_instance_id": "550e8400-e29b-41d4-a716-446655440000",
"key_prefix": "antflydb_abc123",
"key_scope": "instance",
"key_prefix_type": "antflydb",
"name": "Production API Key",
"key_type": "read_only",
"status": "active",
"created_at": "2025-10-02T15:30:00Z",
"last_used_at": "2025-10-02T15:30:00Z",
"expires_at": "2025-10-02T15:30:00Z",
"quota_queries_per_month": 0,
"allowed_tables": [
"string"
],
"allowed_operations": [
"string"
],
"row_filter": {},
"grants": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"organization_id": "550e8400-e29b-41d4-a716-446655440000",
"cloud_instance_id": "550e8400-e29b-41d4-a716-446655440000",
"subject_type": "user",
"subject_id": "550e8400-e29b-41d4-a716-446655440000",
"table_name": "string",
"actions": [
"string"
],
"row_filter": {},
"row_filter_template": {},
"metadata": {},
"created_by": "550e8400-e29b-41d4-a716-446655440000",
"created_at": "2025-10-02T15:30:00Z",
"updated_at": "2025-10-02T15:30:00Z"
}
],
"management_scopes": [
"string"
],
"hosted_inference_limits": {
"allowed_models": [
"string"
],
"requests_per_minute": 0,
"tokens_per_minute": 0,
"concurrent_requests": 0,
"managed_spend_cents_per_day": 0,
"managed_spend_cents_per_month": 0
},
"browser_access": true,
"shared_inference": true
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}Create cloud API key
/organizations/{org_id}/cloud/instances/{instance_id}/api-keysCreate a new API key for accessing the cloud instance
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
instance_id | string | path | Yes | Cloud instance ID |
Request Body
{
"name": "Production API Key",
"key_type": "read_only",
"expires_at": "2025-10-02T15:30:00Z",
"quota_queries_per_month": 0,
"grants": [
{
"table_name": "string",
"actions": [
"string"
],
"row_filter": {},
"row_filter_template": {},
"metadata": {}
}
],
"hosted_inference_limits": {
"allowed_models": [
"string"
],
"requests_per_minute": 0,
"tokens_per_minute": 0,
"concurrent_requests": 0,
"managed_spend_cents_per_day": 0,
"managed_spend_cents_per_month": 0
},
"browser_access": true,
"shared_inference": true
}
Code Examples
curl -X POST "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/instances/550e8400-e29b-41d4-a716-446655440000/api-keys" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Production API Key",
"key_type": "read_only",
"expires_at": "2025-10-02T15:30:00Z",
"quota_queries_per_month": 0,
"grants": [
{
"table_name": "string",
"actions": [
"string"
],
"row_filter": {},
"row_filter_template": {},
"metadata": {}
}
],
"hosted_inference_limits": {
"allowed_models": [
"string"
],
"requests_per_minute": 0,
"tokens_per_minute": 0,
"concurrent_requests": 0,
"managed_spend_cents_per_day": 0,
"managed_spend_cents_per_month": 0
},
"browser_access": true,
"shared_inference": true
}'const response = await fetch("https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/instances/550e8400-e29b-41d4-a716-446655440000/api-keys", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "Production API Key",
"key_type": "read_only",
"expires_at": "2025-10-02T15:30:00Z",
"quota_queries_per_month": 0,
"grants": [
{
"table_name": "string",
"actions": [
"string"
],
"row_filter": {},
"row_filter_template": {},
"metadata": {}
}
],
"hosted_inference_limits": {
"allowed_models": [
"string"
],
"requests_per_minute": 0,
"tokens_per_minute": 0,
"concurrent_requests": 0,
"managed_spend_cents_per_day": 0,
"managed_spend_cents_per_month": 0
},
"browser_access": true,
"shared_inference": true
})
});
const data = await response.json();Responses
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"key": "antflydb_abc123_sk_live_xxxxxxxxxxxxxxxxxxxxx",
"key_prefix": "antflydb_abc123",
"name": "string",
"key_type": "read_only",
"browser_access": true,
"shared_inference": true
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}Update cloud API key
/organizations/{org_id}/cloud/instances/{instance_id}/api-keys/{key_id}Update mutable settings for an instance-scoped antflydb_* API key
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
instance_id | string | path | Yes | Cloud instance ID |
key_id | string | path | Yes | API key ID |
Request Body
{
"hosted_inference_limits": {
"allowed_models": [
"string"
],
"requests_per_minute": 0,
"tokens_per_minute": 0,
"concurrent_requests": 0,
"managed_spend_cents_per_day": 0,
"managed_spend_cents_per_month": 0
}
}
Code Examples
curl -X PATCH "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/instances/550e8400-e29b-41d4-a716-446655440000/api-keys/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"hosted_inference_limits": {
"allowed_models": [
"string"
],
"requests_per_minute": 0,
"tokens_per_minute": 0,
"concurrent_requests": 0,
"managed_spend_cents_per_day": 0,
"managed_spend_cents_per_month": 0
}
}'const response = await fetch("https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/instances/550e8400-e29b-41d4-a716-446655440000/api-keys/550e8400-e29b-41d4-a716-446655440000", {
method: "PATCH",
headers: {
Authorization: "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"hosted_inference_limits": {
"allowed_models": [
"string"
],
"requests_per_minute": 0,
"tokens_per_minute": 0,
"concurrent_requests": 0,
"managed_spend_cents_per_day": 0,
"managed_spend_cents_per_month": 0
}
})
});
const data = await response.json();Responses
{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}Revoke cloud API key
/organizations/{org_id}/cloud/instances/{instance_id}/api-keys/{key_id}Revoke an API key for a cloud instance
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
instance_id | string | path | Yes | Cloud instance ID |
key_id | string | path | Yes | API key ID |
Code Examples
curl -X DELETE "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/instances/550e8400-e29b-41d4-a716-446655440000/api-keys/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/instances/550e8400-e29b-41d4-a716-446655440000/api-keys/550e8400-e29b-41d4-a716-446655440000", {
method: "DELETE",
headers: {
Authorization: "Bearer YOUR_TOKEN"
}
});
const data = await response.json();Responses
{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}Rotate cloud API key
/organizations/{org_id}/cloud/instances/{instance_id}/api-keys/{key_id}/rotateAtomically consume the active key and create one replacement with the same expiry and permissions, preserving explicit grant mode even when no grants remain. Authorization and required audit commit with the rotation.
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
instance_id | string | path | Yes | Cloud instance ID |
key_id | string | path | Yes | API key ID |
Code Examples
curl -X POST "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/instances/550e8400-e29b-41d4-a716-446655440000/api-keys/550e8400-e29b-41d4-a716-446655440000/rotate" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/instances/550e8400-e29b-41d4-a716-446655440000/api-keys/550e8400-e29b-41d4-a716-446655440000/rotate", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_TOKEN"
}
});
const data = await response.json();Responses
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"key": "antflydb_abc123_sk_live_xxxxxxxxxxxxxxxxxxxxx",
"key_prefix": "antflydb_abc123",
"name": "string",
"key_type": "read_only",
"browser_access": true,
"shared_inference": true
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}Rotate Antfly Cloud management API key
/organizations/{org_id}/cloud/api-keys/{key_id}/rotateAtomically consume an active antfly_cloud_* key and create one replacement with the same expiry and scopes. Current caller and target scopes are checked under locks and required audit commits with the rotation.
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
key_id | string | path | Yes | API key ID |
Code Examples
curl -X POST "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/api-keys/550e8400-e29b-41d4-a716-446655440000/rotate" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/cloud/api-keys/550e8400-e29b-41d4-a716-446655440000/rotate", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_TOKEN"
}
});
const data = await response.json();Responses
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"key": "antflydb_abc123_sk_live_xxxxxxxxxxxxxxxxxxxxx",
"key_prefix": "antflydb_abc123",
"name": "string",
"key_type": "read_only",
"browser_access": true,
"shared_inference": true
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}{
"type": "https://platform.antfly.io/errors/validation-error",
"title": "Validation Error",
"status": 400,
"detail": "Email address is required",
"instance": "https://platform.antfly.io/api/v1/users/550e8400-e29b-41d4-a716-446655440000",
"errors": [
{
"field": "string",
"message": "string"
}
]
}