# Checkpoints

Cedana API for checkpoints

## List checkpoints

> Use query params to filter checkpoints. Supports filtering by \`ids\` (comma-separated UUIDs for single or multiple checkpoints)

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-staging"},"tags":[{"name":"Checkpoints","description":"Cedana API for checkpoints"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"http","scheme":"bearer"}},"schemas":{"Checkpoint":{"type":"object","description":"Checkpoint is basic unit for cedana service operation\nit stores all the information regarding the snapshot we can use to save and then restore state","required":["id","status","gpu","platform"],"properties":{"checksum":{"type":["string","null"]},"gpu":{"type":"string"},"id":{"type":"string","format":"uuid"},"info":{},"name":{"type":["string","null"]},"platform":{"type":"string"},"status":{"$ref":"#/components/schemas/CheckpointStatus"}}},"CheckpointStatus":{"type":"string","enum":["initializing","updated_info","possibly_uploaded","ready","deprecated"]},"ApiError":{"type":"object","description":"Standard error response for API endpoints","required":["message"],"properties":{"code":{"type":["string","null"],"description":"HTTP status code"},"details":{"description":"Optional additional error details"},"message":{"type":"string","description":"Error message describing what went wrong"}}}}},"paths":{"/v2/checkpoints":{"get":{"tags":["Checkpoints"],"summary":"List checkpoints","description":"Use query params to filter checkpoints. Supports filtering by `ids` (comma-separated UUIDs for single or multiple checkpoints)","operationId":"list","parameters":[{"name":"ids","in":"query","description":"Comma-separated list of checkpoint UUIDs to filter by","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Returns checkpoints","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Checkpoint"}}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Failed to connect/fetch from database","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}
```

## Create checkpoint

> Builds a new checkpoint without the metadata and information about the checkpoint with status initializing

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-staging"},"tags":[{"name":"Checkpoints","description":"Cedana API for checkpoints"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"http","scheme":"bearer"}},"schemas":{"ApiError":{"type":"object","description":"Standard error response for API endpoints","required":["message"],"properties":{"code":{"type":["string","null"],"description":"HTTP status code"},"details":{"description":"Optional additional error details"},"message":{"type":"string","description":"Error message describing what went wrong"}}}}},"paths":{"/v2/checkpoints":{"post":{"tags":["Checkpoints"],"summary":"Create checkpoint","description":"Builds a new checkpoint without the metadata and information about the checkpoint with status initializing","operationId":"add","responses":{"200":{"description":"Returns the checkpoint ID for the new checkpoint","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Failed to create checkpoint in database","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}
```

## Deprecate checkpoint

> Marks checkpoint as deprecated, so that they can be removed on next internal state cleanup

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-staging"},"tags":[{"name":"Checkpoints","description":"Cedana API for checkpoints"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"http","scheme":"bearer"}},"schemas":{"ApiError":{"type":"object","description":"Standard error response for API endpoints","required":["message"],"properties":{"code":{"type":["string","null"],"description":"HTTP status code"},"details":{"description":"Optional additional error details"},"message":{"type":"string","description":"Error message describing what went wrong"}}}}},"paths":{"/v2/checkpoints/deprecate/{id}":{"patch":{"tags":["Checkpoints"],"summary":"Deprecate checkpoint","description":"Marks checkpoint as deprecated, so that they can be removed on next internal state cleanup","operationId":"deprecate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully deprecated checkpoint and returns id","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Invalid UUID provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Failed to execute request against database","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}
```

## Put checkpoint info

> Add information about the checkpoint

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-staging"},"tags":[{"name":"Checkpoints","description":"Cedana API for checkpoints"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"http","scheme":"bearer"}},"schemas":{"CheckpointInfo":{"type":"object","required":["gpu","platform"],"properties":{"gpu":{"type":"string"},"info":{},"platform":{"type":"string"}}},"ApiError":{"type":"object","description":"Standard error response for API endpoints","required":["message"],"properties":{"code":{"type":["string","null"],"description":"HTTP status code"},"details":{"description":"Optional additional error details"},"message":{"type":"string","description":"Error message describing what went wrong"}}}}},"paths":{"/v2/checkpoints/info/{id}":{"put":{"tags":["Checkpoints"],"summary":"Put checkpoint info","description":"Add information about the checkpoint","operationId":"update_info","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckpointInfo"}}},"required":true},"responses":{"200":{"description":"Successfully updated checkpoint info and returns ID","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Failed to execute request against database","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}
```

## Uploaded checkpoint

> Marks checkpoint as successfully uploaded and ready for restore

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-staging"},"tags":[{"name":"Checkpoints","description":"Cedana API for checkpoints"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"http","scheme":"bearer"}},"schemas":{"CheckpointSuccessInfo":{"type":"object","properties":{"restore_path":{"type":["string","null"]}}},"ApiError":{"type":"object","description":"Standard error response for API endpoints","required":["message"],"properties":{"code":{"type":["string","null"],"description":"HTTP status code"},"details":{"description":"Optional additional error details"},"message":{"type":"string","description":"Error message describing what went wrong"}}}}},"paths":{"/v2/checkpoints/uploaded/{id}":{"post":{"tags":["Checkpoints"],"summary":"Uploaded checkpoint","description":"Marks checkpoint as successfully uploaded and ready for restore","operationId":"uploaded","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckpointSuccessInfo"}}},"required":true},"responses":{"200":{"description":"Marks the checkpoint as successfully uploaded","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Failed to update checkpoint in database","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cedana.ai/references/api/checkpoints.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
