ChartnautDocs

Chartnaut API

Author and run indicators, definitions and studies on Chartnaut compute

Base URL and keys#

Base URL
https://api.chartnaut.com/v1
Authentication
Authorization: Bearer $CHARTNAUT_API_KEY
Version
1.0.0-draft · OpenAPI 3.1.0

The public API, called with a personal API key (the CLI's chartnaut login, or Developers → CLI and API keys). A key works in the region where it was made.

A personal API token (cn_live_…) minted in Settings → Developers (terminal.chartnaut.com/morpheus/settings/developers). Stored hashed; shown once. Scopes: scripts:read (every GET, and validate), scripts:write (create, save, patch, delete), runs:write (start and cancel runs). 300 requests a minute per token. The same token works for the CLI and the MCP server.

The public contract behind the Chartnaut CLI and the Chartnaut MCP server. Every CLI command and every MCP tool is a call to an operation in this file; neither has operations of its own.

Design rules (see README.md for the reasoning):

  • Public names only. definition (never "flow"), run, script, version. No internal type is ever serialised directly; every response is a DTO here.
  • Versions are immutable. slug@3 means the same code and the same dependency pins forever. A bare slug resolves to the latest version at run time and the run records which version it used.
  • Every run is async. wait lets short runs return finished in one call.
  • No raw market data. Runs return what the script produced (series, events, study results), never candles or tape.
  • A save that is not runnable fails (422). There is no "saved but not promoted" success.

Errors#

Error.

Body

object · Error
errorobjectRequired
Show fields
codestringRequired

Stable. Branch on this, never on message.

One of unauthorized forbidden_scope plan_limit not_found version_conflict script_invalid in_use out_of_coverage unknown_instrument ambiguous_instrument unsupported_timeframe run_not_finished rate_limited busy invalid_request forbidden conflict not_in_library confirmation_required not_shared not_installable not_implemented authorization_pending slow_down access_denied expired_token internal
messagestringRequired
detailsobject
docs_urlstring (uri)
request_idstring

Pagination#

cursorstring

Opaque cursor from a previous page's next_cursor.

limitinteger
Default 501 to 500

A page carries

object · Page
next_cursorstringNullable

Idempotency#

Idempotency-Key header

Any unique string. A retry with the same key within 24h returns the first response instead of creating a second script, version or run.

Endpoints#

Library

Every script the caller can use: their own, Chartnaut's built-ins, other people's public scripts and the ones they added to their library. Described by ref; source is never returned. Another author's script runs only once it is added to the caller's library, which also adds the scripts it needs after an explicit confirm.

Docs

The scripting reference, served in slices sized for an agent's context.

Projects

Your developer projects (once called apps): the Chartnaut side of what you build with the SDK. Test keys and Test sites only; Live keys and Live sites are made on the Developers page.