Skip to main content

Anyscale API reference

This page provides an overview of the Anyscale APIs and provides links to API references.

What is an Anyscale API?

Anyscale APIs are a collection developer tools for programmatic interaction with the Anyscale platform. Most Anyscale APIs have the following three components:

ComponentDescription
CLIA command line interface for running commands from a terminal or Bash script. See Anyscale CLI overview.
SDKA Python software development kit for interacting with Anyscale infrastructure from Python applications. See Anyscale Python SDK overview.
ModelsObjects that represent Anyscale components using structured fields and values, used with the CLI or SDK. See Models in the Anyscale API.

The Anyscale platform is optimized for running Ray applications. Use the following Ray documentation to review the API reference for Ray Core and the Ray AI libraries:

Option naming for Anyscale APIs

Most options in the Anyscale CLI, SDK, and models use the following general rules for naming:

  • The CLI uses feature flags for specifying options and hyphens for multi-word options. Some CLI commands provide optional positional arguments and have alternate short flags for command options.
  • The SDK uses standard Python casing for classes, functions, and parameters.
  • Most keywords in models share the same snakecase formatting for both the SDK and CLI.

The following table shows an example of specifying the working directory for a job or service:

CLISDK modelYAML config for CLI
--working-dir ./pathworking_dir="./path"working_dir: "./path"

Anyscale CLI overview

The Anyscale command line interface (CLI) provides programmatic tools for authenticating and interacting with the Anyscale platform from the command line, Bash scripts, and other similar tooling. See CLI configuration.

Use the following links to navigate to CLI docs for common Anyscale features:

Anyscale Python SDK overview

The Anyscale Python software develoment kit (SDK) provides a set of classes and methods to programmatically interact with features and products in the Anyscale platform. See Get started with the Anyscale SDK.

note

Some Anyscale APIs are available in the CLI but not the SDK. Contact Anyscale support to request new functionality.

Use the following links to navigate to SDK docs for common Anyscale features:

Models in the Anyscale API

Anyscale API models are data structures that define or describe Anyscale infrastructure.

Anyscale formats field names returned in response models to match field names in configuration models. You can use either the CLI or SDK to programmatically capture information about existing resources and reuse those fields and values to construct configuration models for other API calls.

The following table provides a high-level overview of configuration and response models for the SDK and CLI:

SDKCLI
ConfigurationUse Python classes with keyword arguments to build out configurations for other SDK methods.Use YAML config files to pass options to CLI commands in a structured format.
ResponseUse Python classes to capture the return from SDK methods in a structured format.CLI commands return information about Anyscale assets structured as YAML.

Models in the SDK have a to_dict() method that allows you output the contents of a model formatted as a Python dict. The dict keys have the same names as keyword arguments for the model.

Use the following links to navigate to models for common API features: