Overview
Account Feature Required: Model sharing is an account-level feature. If your account does not have model sharing enabled, the API will return a 403 Forbidden error. Please contact Xerotier.ai support to enable model sharing on your account.
When you share a model:
- The model becomes visible in the public catalog
- Other Xerotier.ai users can discover and create endpoints using your model
- You retain ownership and can unshare at any time
- Existing endpoints continue to function even after unsharing
Share Model
POST
/proj_ABC123/v1/models/{modelId}/share
Shares a model to the public catalog, making it discoverable and usable by other Xerotier.ai users.
Requirements
- User must have admin role in the project
- Model must be in
active or ready status
- Account must have model sharing feature enabled
curl -X POST https://xerotier.ai/proj_ABC123/v1/models/550e8400-e29b-41d4-a716-446655440000/share \
-H "Authorization: Bearer xero_myproject_your_api_key"
import requests
API_KEY = "xero_myproject_your_api_key"
BASE_URL = "https://xerotier.ai/proj_ABC123/v1"
MODEL_ID = "550e8400-e29b-41d4-a716-446655440000"
response = requests.post(
f"{BASE_URL}/models/{MODEL_ID}/share",
headers={"Authorization": f"Bearer {API_KEY}"}
)
if response.status_code == 200:
data = response.json()
print(f"Model shared: {data['shared']}")
else:
print(f"Error: {response.json()}")
Response
{
"modelId": "550e8400-e29b-41d4-a716-446655440000",
"shared": true,
"sharedAt": "2026-01-15T10:30:00Z"
}
Unshare Model
POST
/proj_ABC123/v1/models/{modelId}/unshare
Removes a model from the public catalog. The model will no longer be discoverable by other users, but existing endpoints using the model will continue to function.
Requirements
- User must have admin role in the project
- Model must currently be shared
curl -X POST https://xerotier.ai/proj_ABC123/v1/models/550e8400-e29b-41d4-a716-446655440000/unshare \
-H "Authorization: Bearer xero_myproject_your_api_key"
import requests
API_KEY = "xero_myproject_your_api_key"
BASE_URL = "https://xerotier.ai/proj_ABC123/v1"
MODEL_ID = "550e8400-e29b-41d4-a716-446655440000"
response = requests.post(
f"{BASE_URL}/models/{MODEL_ID}/unshare",
headers={"Authorization": f"Bearer {API_KEY}"}
)
if response.status_code == 200:
data = response.json()
print(f"Model unshared: {not data['shared']}")
else:
print(f"Error: {response.json()}")
Response
{
"modelId": "550e8400-e29b-41d4-a716-446655440000",
"shared": false,
"unsharedAt": "2026-01-15T12:00:00Z"
}
Error Responses
| HTTP Status |
Error |
Description |
| 403 |
feature_not_enabled |
Model sharing is not enabled on your account. Contact Xerotier.ai support. |
| 403 |
permission_denied |
User does not have admin role in the project. |
| 400 |
invalid_model_status |
Model is not in a valid status for sharing (must be active or ready). |
| 404 |
model_not_found |
The specified model does not exist or you do not have access to it. |