API reference

API v1

Endpoints, authentication and responses.

Basics

  • Overview
    The base address, the shape of a request and of an answer, and the conventions every operation of the API follows.
    4 min
  • Authentication
    How a request says who it is — the API key, the one project the key acts in, and the scopes that say what it may do.
    3 min
  • Requests
    The headers a request sends and an answer carries, how a long list is read page by page, and how many requests a key may send.
    4 min
  • Idempotency
    The Idempotency-Key header — which requests require it, what a repeated request is answered with, and how to choose a key.
    4 min
  • Error codes
    The envelope of an error, where its code comes from, and every code the API answers with — what each means and asks you to do.
    4 min
  • Webhooks
    What a delivery of a webhook carries, how to check its signature, when it is sent again, and what each family of events reports.
    6 min
  • OpenAPI specification
    What the OpenAPI document of the Slen API holds, how the pages of this section are made of it, and how to read the page of an operation.
    3 min

Resources

  • Operations
    Send a request through the flow bound to an operation code, read the operations — the model calls of the flows — with every attempt behind them, and list the holds of those calls.
  • Executions
    Read the status of an execution while it runs, and its trace node by node once it has moved.
  • Customers and credits
    Add your customers, keep their credit accounts, top up, charge and adjust their credits, block a customer, and set what an operation costs in credits.
  • Approvals
    List the requests for approval that executions wait on, and approve or reject one.
  • Models
    Read the models a request may name and the price each of them is charged at now.
  • Flows
    Create a flow, save its draft, check and publish it, roll it back, give it an operation code, and read its executions and analytics.
  • Budgets
    List the budgets with what is left of them, create a budget, change its limit, and archive or restore it.
  • Alerts
    Read the feed of the alerts that opened in a project, and mark an alert as seen.
  • Analytics
    Read what a project spent, how its executions ended, how close the estimates of its model calls were and what its customers cost.
  • Ledger entries
    Read the journal of the money a project held, gave back and spent, entry by entry.
  • Provider connections
    Store the API key of a model provider, check that it works, set its rate limits and take it out of use for a while.
  • Provider pools
    Create a pool of provider connections, arrange its members, read their live headroom and how the pool served its calls.
  • Health probes
    Two probes that take no key say whether the API serves and whether its dependencies answer, and one operation says what happens while the ledger is unreachable.