Skip to main content
These clients cover everything beside client.runs. Every method is in the Python SDK reference. The examples run inside async with ValkyrieClient() as client:, as in the quickstart.

Read tasks

tasks returns one page. To walk every page with the same filters:
Pages use offsets, so a task whose status changes while you read can move between pages.

Read logs

query matches text in log messages. Times need a time zone, and logs at exactly those times are included. page_run and page_task load one page at a time.

Download artifacts

list returns one page of paths under prefix; pass its next_cursor as cursor for the next. download_url returns a temporary link to one file, and download saves a file or folder into a new directory.

Page through the sandbox queue

client.scheduler.overview returns what valkyrie queue status shows. The waiting and active lists page separately. Stop reading a list when its next offset is None:
Use active_entries, active_offset, and active_next_offset the same way for active tasks. The queue changes between calls, so a task can appear on two pages or on none.

Manage projects

Every run spends for a project. Create one once, then start runs in it by its handle:
The fields match valkyrie project create. To move a run to another project, see client.runs.retag.

Manage agents

The methods match valkyrie agent, including install from GitHub and remove.

Store secrets and choose providers

Store a secret, then use the reference it returns wherever a run or mapping names a secret:
Values are never returned, and a secret set or removed in the last few minutes might not appear in list yet. Your default provider and saved benchmark services are your own settings in the current organization:
Changing settings needs a login. An access key reads its creator’s settings but can’t change them. See Configure sandbox providers and Benchmark authentication.

Query benchmark services

list checks that every service responds, and catalog returns the hosted services without checking them. task_ids uses the URL you saved for the benchmark, if any. To ask the hosted service, pass ignore_custom_services=True. To send extra headers, pass service_headers.