Permissions (Scopes)
Every API key, and every app you connect to your Nosana account, carries a set of permissions, also called scopes. A request can only do what its permissions allow. A key that can view your credits can't post a job or spend them.
When you sign in to Nosana Deploy yourself, you aren't limited: your own session always has every permission.
Available permissions
| Permission | Allows | API keys | Apps & MCP |
|---|---|---|---|
credits:read | View your credit balance, transactions and spending history | ✓ | ✓ |
inference:use | Run LLM inference (spends credits) | ✓ | — |
jobs:read | Read the status, results and endpoints of jobs you've run | ✓ | ✓ |
jobs:write | Create, extend and stop jobs (spends credits) | ✓ | ✓ |
deployments:read | View your deployments | ✓ | ✓ |
deployments:write | Create, update and delete your deployments (spends credits) | ✓ | ✓ |
wallet:sign | Sign messages with your Nosana wallet key | ✓ | ✓ |
api-keys:manage | Create, view and revoke your API keys | ✓ | — |
oauth-apps:manage | Manage the OAuth apps you own | ✓ | — |
Three permissions are for API keys only:
inference:use: the inference endpoints only accept API keys.api-keys:manageandoauth-apps:manage: an app that could create API keys could keep access to your account after you disconnect it.
WARNING
wallet:sign lets its holder sign messages as your wallet. The SDK uses it to reach your running jobs directly on their node, and that includes stopping them (see Manage an Active Job). Only grant it to keys and apps you trust with that. To read job data without it, use jobs:read (Read Job Data).
To build a permission picker of your own, fetch the current list from GET https://api.nosana.com/auth/scopes. No key is needed. Each entry's oauthGrantable flag tells you whether apps can use it.
API keys
Choose a key's permissions when you create it:
- In the dashboard, tick Read and Write for each resource in the Create API Key dialog (see Get API Key).
- With the SDK or over HTTP, pass a
scopesarray:
const const created: {
llmModels: (string[] | null) | null;
key: string;
id: string;
name: string;
status: string;
scopes: string[];
expiresAt: (string | null) | null;
createdAt: string;
}
created = await const client: NosanaClientclient.NosanaClient.api: NosanaApiClientapi.user: NosanaUserApiuser.NosanaUserApi.apiKeys: {
create: (request: CreateApiKeyRequest) => Promise<ApiKeyCreated>;
list: () => Promise<{
keys: ApiKey[];
total: number;
}>;
get: (id: string) => Promise<ApiKey>;
update: (id: string, request: UpdateApiKeyRequest) => Promise<ApiKey>;
delete: (id: string) => Promise<{
success: boolean;
}>;
}
apiKeys.create: (request: CreateApiKeyRequest) => Promise<ApiKeyCreated>create({
name: stringname: 'read-only-monitoring',
scopes?: string[] | undefinedscopes: ['credits:read', 'jobs:read', 'deployments:read'],
});
var console: ConsoleThe `console` module provides a simple debugging console that is similar to the
JavaScript console mechanism provided by web browsers.
The module exports two specific components:
* A `Console` class with methods such as `console.log()`, `console.error()` and `console.warn()` that can be used to write to any Node.js stream.
* A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstdout) and
[`process.stderr`](https://nodejs.org/docs/latest-v24.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module.
_**Warning**_: The global console object's methods are neither consistently
synchronous like the browser APIs they resemble, nor are they consistently
asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v24.x/api/process.html#a-note-on-process-io) for
more information.
Example using the global `console`:
```js
console.log('hello world');
// Prints: hello world, to stdout
console.log('hello %s', 'world');
// Prints: hello world, to stdout
console.error(new Error('Whoops, something bad happened'));
// Prints error message and stack trace to stderr:
// Error: Whoops, something bad happened
// at [eval]:5:15
// at Script.runInThisContext (node:vm:132:18)
// at Object.runInThisContext (node:vm:309:38)
// at node:internal/process/execution:77:19
// at [eval]-wrapper:6:22
// at evalScript (node:internal/process/execution:76:60)
// at node:internal/main/eval_string:23:3
const name = 'Will Robinson';
console.warn(`Danger ${name}! Danger!`);
// Prints: Danger Will Robinson! Danger!, to stderr
```
Example using the `Console` class:
```js
const out = getStreamSomehow();
const err = getStreamSomehow();
const myConsole = new console.Console(out, err);
myConsole.log('hello world');
// Prints: hello world, to out
myConsole.log('hello %s', 'world');
// Prints: hello world, to out
myConsole.error(new Error('Whoops, something bad happened'));
// Prints: [Error: Whoops, something bad happened], to err
const name = 'Will Robinson';
myConsole.warn(`Danger ${name}! Danger!`);
// Prints: Danger Will Robinson! Danger!, to err
```console.Console.log(message?: any, ...optionalParams: any[]): void (+1 overload)Prints to `stdout` with newline. Multiple arguments can be passed, with the
first used as the primary message and all additional used as substitution
values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html)
(the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args)).
```js
const count = 5;
console.log('count: %d', count);
// Prints: count: 5, to stdout
console.log('count:', count);
// Prints: count: 5, to stdout
```
See [`util.format()`](https://nodejs.org/docs/latest-v24.x/api/util.html#utilformatformat-args) for more information.log('New key:', const created: {
llmModels: (string[] | null) | null;
key: string;
id: string;
name: string;
status: string;
scopes: string[];
expiresAt: (string | null) | null;
createdAt: string;
}
created.key: stringkey);Good to know:
- No
scopesmeans everything you have. A key created withoutscopesgets every permission of whoever creates it. - A key restricted to LLM models (
llmModels) gets onlyinference:useby default. - A key can't hand out more than it has. A key with
api-keys:managecan only create keys with permissions it holds itself (403otherwise). An unknown scope name is a400. - Permissions can't be changed later. To change them, create a new key and revoke the old one.
- Keys created before permissions existed have full access.
To see what a key can do, call client.api.auth.validateApiKey(key) (POST /auth/validate-api-key). Its response includes the key's scopes.
Apps and MCP
Apps that use Connect with Nosana, and AI assistants connected to the MCP server, act on your behalf with an access token. That token carries only the permissions you approved:
- When an app is registered (Account → Connected Apps), its owner chooses the most it can ever ask for.
- When someone signs in, the app asks for some or all of those permissions. By default the Connect SDK asks for everything the app was registered with. Pass
scopesto ask for less (see Choose what your app can do). - The consent screen lists what the app is asking for. The user approves or declines the whole request.
When a permission is missing
A request without the permission it needs is rejected with 403 Forbidden:
{
"message": "Insufficient scope. This endpoint requires: jobs:write.",
"code": "INSUFFICIENT_SCOPE"
}The WWW-Authenticate header names the missing permission in a machine-readable form:
WWW-Authenticate: Bearer error="insufficient_scope", scope="jobs:write"To fix it, create a key that includes the permission, or sign in to the app again and approve the permission it asks for.