Skip to content

Nosana API ​

Nosana exposes both a REST HTTP API and a typed TypeScript SDK so you can create and manage deployments from whatever environment fits your workflow.

New here? Follow the Your First Job guide for an end-to-end walkthrough: pick a market, validate a job definition, post it with credits, and fetch the results.

HTTP API ​

Use the Nosana HTTP API to create and manage deployments from any language or environment that can make HTTPS requests.

Prerequisites ​

Before calling the API, ensure you have:

  • API key: A valid Nosana API key. See the API key guide.
  • Credits: Sufficient credit balance on your Nosana account to run deployments.
  • Base URL: The current production API base URL:
bash
https://api.nosana.com

Authentication ​

You can authenticate with the API in two ways:

API Key Authentication ​

All requests must include your API key as a Bearer token:

bash
curl -H "Authorization: Bearer nos_xxx_your_api_key" ...

If you are using environment variables:

bash
export NOSANA_API_KEY="nos_xxx_your_api_key"

curl -H "Authorization: Bearer $NOSANA_API_KEY" ...

Wallet Authentication ​

For wallet-based authentication with vault management capabilities, see the Wallet Authentication guide.

API Reference (Swagger) ​

You can explore all available endpoints and schemas in the interactive Swagger UI:

Use this reference to:

  • Inspect request/response payloads
  • Try out endpoints directly in the browser
  • Generate or validate client code

API Modules ​

The Nosana API is organized into several modules — see the API Reference overview for the full list:

  • Deployments - Create and manage deployments, including vaults
  • Jobs - Manage individual jobs, extend execution time, stop jobs
  • Markets - Discover GPU markets and check resource requirements
  • Credits - Check balance, claim/request credits, spending history
  • Authentication & API Keys - Validate credentials, manage API keys
  • Templates - Ready-made deployment templates
  • Hosts - Nodes & GPU hosts: discovery, metrics, rewards
  • Stats - Network statistics, NOS price, earning/spending history
  • Payments - Payment methods and credit purchases
  • Benchmarks - Benchmark data and thresholds
  • Raw Clients - Typed clients for every other endpoint

TypeScript SDK ​

The Nosana TypeScript SDK provides a convenient, typed interface for creating and managing deployments from Node.js or browser environments.

Prerequisites ​

Before using the SDK, ensure you have:

  • API Key: A valid Nosana API key. See the API key guide.
  • Credits: Sufficient credits in your Nosana account to run deployments.
  • Node.js: A recent LTS version of Node.js is recommended.

Installation ​

Install the SDK from npm:

bash
npm install @nosana/kit

For more installation options and details, see the Kit Installation Guide.

Initializing the Client ​

ts
import { 
function createNosanaClient(network: NosanaNetwork | undefined, customConfig: PartialClientConfig & {
    connect: ConnectFactoryConfig & {
        clientSecret: string;
    };
}): NosanaClient & {
    connect: ServerConnect;
} (+3 overloads)
createNosanaClient
,
type NosanaNetwork = "mainnet" | "devnet" | "localnet"
const NosanaNetwork: {
    readonly MAINNET: "mainnet";
    readonly DEVNET: "devnet";
    readonly LOCALNET: "localnet";
}
NosanaNetwork
} from '@nosana/kit';
const const client: NosanaClientclient = function createNosanaClient(network?: NosanaNetwork, customConfig?: PartialClientConfig): NosanaClient (+3 overloads)createNosanaClient(
const NosanaNetwork: {
    readonly MAINNET: "mainnet";
    readonly DEVNET: "devnet";
    readonly LOCALNET: "localnet";
}
NosanaNetwork
.type MAINNET: "mainnet"MAINNET, {
PartialClientConfig.api?: Partial<APIConfig> | undefinedapi: { apiKey?: string | undefinedapiKey:
const process: {
    env: Record<string, string>;
}
process
.env: Record<string, string>env.stringNOSANA_API_KEY,
}, });

Route groups & raw clients ​

The SDK exposes the API as typed route groups under client.api — auth, user, jobs, credits, markets, deployments, templates, hosts, stats, payments, and benchmarks. See the API Reference overview for every group and its methods.

For any endpoint without a curated method, use the raw, fully-typed per-service clients at client.api.clients.{clientManager,hostManager,blockchainIndexer,deploymentManager} — authentication is applied automatically. See Raw Clients.