Raw Clients
The curated route groups cover the consumer- and node-facing endpoints. Any endpoint that doesn't have a curated method (for example admin or ops routes) is still reachable through the underlying, fully-typed openapi-fetch clients at client.api.clients. Authentication is applied automatically — you don't add headers yourself.
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 },
});
// every route of each service, typed against its OpenAPI schema:
const client: NosanaClientclient.NosanaClient.api: NosanaApiClientapi.clients: NosanaClientsThe raw, fully-typed per-service OpenAPI clients. Use these to call any
endpoint not covered by the curated groups above — every route of each
service is available with path autocompletion and typed params/responses,
e.g. `api.clients.hostManager.POST('/nodes/ban', { body })`.clients.NosanaClients.clientManager: Client<AuthenticatedPaths<paths>, `${string}/${string}`>clientManager;
const client: NosanaClientclient.NosanaClient.api: NosanaApiClientapi.clients: NosanaClientsThe raw, fully-typed per-service OpenAPI clients. Use these to call any
endpoint not covered by the curated groups above — every route of each
service is available with path autocompletion and typed params/responses,
e.g. `api.clients.hostManager.POST('/nodes/ban', { body })`.clients.NosanaClients.hostManager: Client<AuthenticatedPaths<paths>, `${string}/${string}`>hostManager;
const client: NosanaClientclient.NosanaClient.api: NosanaApiClientapi.clients: NosanaClientsThe raw, fully-typed per-service OpenAPI clients. Use these to call any
endpoint not covered by the curated groups above — every route of each
service is available with path autocompletion and typed params/responses,
e.g. `api.clients.hostManager.POST('/nodes/ban', { body })`.clients.NosanaClients.blockchainIndexer: Client<AuthenticatedPaths<paths>, `${string}/${string}`>blockchainIndexer;
const client: NosanaClientclient.NosanaClient.api: NosanaApiClientapi.clients: NosanaClientsThe raw, fully-typed per-service OpenAPI clients. Use these to call any
endpoint not covered by the curated groups above — every route of each
service is available with path autocompletion and typed params/responses,
e.g. `api.clients.hostManager.POST('/nodes/ban', { body })`.clients.NosanaClients.deploymentManager: DeploymentManagerClientdeploymentManager;
// e.g. call a route not exposed as a curated method:
const { const data: undefineddata, const error: undefinederror } = await const client: NosanaClientclient.NosanaClient.api: NosanaApiClientapi.clients: NosanaClientsThe raw, fully-typed per-service OpenAPI clients. Use these to call any
endpoint not covered by the curated groups above — every route of each
service is available with path autocompletion and typed params/responses,
e.g. `api.clients.hostManager.POST('/nodes/ban', { body })`.clients.NosanaClients.hostManager: Client<AuthenticatedPaths<paths>, `${string}/${string}`>hostManager.Client<AuthenticatedPaths<paths>, `${string}/${string}`>.GET: <"/nodes/{id}/full", {
params: {
path: {
id: string;
};
};
}>(url: "/nodes/{id}/full", init_0: {
params: {
path: {
id: string;
};
};
} & {
[key: string]: unknown;
}) => Promise<FetchResponse<{
parameters: {
header?: {
authorization: string;
} | undefined;
} & {
path: {
id: string;
};
};
} & {
responses: {
200: {
headers: {
[name: string]: unknown;
};
content?: never;
};
};
}, {
params: {
path: {
id: string;
};
};
}, `${string}/${string}`>>
Call a GET endpointGET(
'/nodes/{id}/full',
{ params: {
path: {
id: string;
};
}
params: { path: {
id: string;
}
path: { id: stringid: const nodeAddress: stringnodeAddress } } },
);Path, params and response are all type-checked against the generated OpenAPI schema, so your editor autocompletes routes and payloads.
Services
| Client | Serves | Base URL (mainnet) |
|---|---|---|
clients.clientManager | Auth, API keys, credits, payments, templates, job writes | https://client-manager.k8s.prd.nosana.com |
clients.blockchainIndexer | Job & stats reads | https://blockchain-indexer.k8s.prd.nos.ci |
clients.deploymentManager | Deployments & vaults | https://deployment-manager.k8s.prd.nos.ci |
clients.hostManager | Markets, nodes, benchmarks | https://host-manager.k8s.prd.nosana.com |
All four services are also reachable through a single proxy at https://api.nosana.com.
The full mapping of every production endpoint to its SDK method (and which endpoints are raw-client-only) is maintained in packages/api/API_ENDPOINTS.md.