API Reference

The recommended way to interact with the Cosmic API is by using one of our official SDKs. Today, Cosmic offers a REST API and JavaScript SDK to give you the best experience when consuming the API.

API base URL

The base URL for all requests is noted below.

Base URL


API status

You can check the API status at the following endpoint. You can also subscribe to status updates on the Cosmic status page.

Status endpoint


Install the Cosmic JavaScript SDK

The following examples include methods using the Cosmic JavaScript SDK. To run the examples, first install the NPM module using one of the following commands. Make sure you have Node.js installed on your machine (recomended version: v18.*).

Install the Cosmic JavaScript SDK

yarn add @cosmicjs/sdk
# OR
pnpm add @cosmicjs/sdk
# OR
npm install @cosmicjs/sdk