API Reference

We offer a powerful REST API to interact with your Cosmic content. We recommend using one of the available SDKs which provide an enhanced development experience.

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 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
# OR
bun add @cosmicjs/sdk

Install the Swift SDK

In certain cases, there are also methods that use the Cosmic Swift SDK. To run the examples, first install the Swift package using Swift Package Manager.

Install the Cosmic Swift SDK

.package(url: "https://github.com/cosmicjs/cosmic-sdk-swift.git", from: "1.0.0")