Skip to content

Instantly share code, notes, and snippets.

@zeke
Created June 16, 2025 18:36
Show Gist options
  • Save zeke/8637202c3cf1896f3fbf4070317f098a to your computer and use it in GitHub Desktop.
Save zeke/8637202c3cf1896f3fbf4070317f098a to your computer and use it in GitHub Desktop.
A demo of the unneeded OpenAPI "paths" data formerly returned by Replicate's API for serialized model versions.
curl -s \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
https://api.replicate.com/v1/models/replicate/hello-world \
| jq .latest_version.openapi_schema.paths
{
"/": {
"get": {
"summary": "Root",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"title": "Response Root Get"
}
}
},
"description": "Successful Response"
}
},
"operationId": "root__get"
}
},
"/shutdown": {
"post": {
"summary": "Start Shutdown",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"title": "Response Start Shutdown Shutdown Post"
}
}
},
"description": "Successful Response"
}
},
"operationId": "start_shutdown_shutdown_post"
}
},
"/predictions": {
"post": {
"summary": "Predict",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PredictionResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"parameters": [
{
"in": "header",
"name": "prefer",
"schema": {
"type": "string",
"title": "Prefer"
},
"required": false
}
],
"description": "Run a single prediction on the model",
"operationId": "predict_predictions_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PredictionRequest"
}
}
}
}
}
},
"/health-check": {
"get": {
"summary": "Healthcheck",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"title": "Response Healthcheck Health Check Get"
}
}
},
"description": "Successful Response"
}
},
"operationId": "healthcheck_health_check_get"
}
},
"/predictions/{prediction_id}": {
"put": {
"summary": "Predict Idempotent",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PredictionResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"parameters": [
{
"in": "path",
"name": "prediction_id",
"schema": {
"type": "string",
"title": "Prediction ID"
},
"required": true
},
{
"in": "header",
"name": "prefer",
"schema": {
"type": "string",
"title": "Prefer"
},
"required": false
}
],
"description": "Run a single prediction on the model (idempotent creation).",
"operationId": "predict_idempotent_predictions__prediction_id__put",
"requestBody": {
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/PredictionRequest"
}
],
"title": "Prediction Request"
}
}
},
"required": true
}
}
},
"/predictions/{prediction_id}/cancel": {
"post": {
"summary": "Cancel",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"title": "Response Cancel Predictions Prediction Id Cancel Post"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"parameters": [
{
"in": "path",
"name": "prediction_id",
"schema": {
"type": "string",
"title": "Prediction ID"
},
"required": true
}
],
"description": "Cancel a running prediction",
"operationId": "cancel_predictions__prediction_id__cancel_post"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment