Documentation / Developer Tool

Endpoint (API Maker)

Give anything an Ocalt app does its own web address, and call it like any API. No code to write.

Open Endpoint

Overview

Endpoint turns one thing an Ocalt app does into a web address that answers. Pick the app, pick what it should do, say what the caller sends and what comes back, and you get an address like https://endpoint.ocalt.com/k2v8q0r4m7x1c9b3n6t5w2ya. A website, a phone app, a spreadsheet or a script can then call it, the same way it would call any other API.

  • Any app: Fabric, Ocaltio, Ocalt Email, ClockWork, Forge, Pinstant, Flow, Alter, Orbit, Clusters, Grimoire, Olde, OcaltDB and Omni, each with the things it can do listed in plain words.
  • Try before it is live: run it as yourself, see the real answer, and choose which fields come back.
  • Private when it needs to be: open to anyone with the address, or only to callers with a key you get once.
  • Every call counted: calls per day, failures, response times, the last calls and a playground that calls the real address.

Getting started

  1. Open endpoint.ocalt.com and sign in with your Ocalt account.
  2. Press New endpoint and pick an app.
  3. Pick what it should do. Each choice shows the inputs it takes.
  4. Shape it: for each input, choose Caller sends it or Always the same. Choose what comes back: the whole answer, only some fields, or the answer wrapped in {ok, data}. Choose who can call it.
  5. Press Try it to see a real answer, then Make the endpoint. Copy the address and the ready-made examples for curl, JavaScript and Python.

Calling an endpoint

Inputs can be sent in the address, as a form, or as a JSON object. GET and POST both work, and every answer allows calls from any website (CORS).

With inputs in the address
curl "https://endpoint.ocalt.com/k2v8q0r4m7x1c9b3n6t5w2ya?folder=/root/reports"
With JSON and a key
curl -X POST https://endpoint.ocalt.com/k2v8q0r4m7x1c9b3n6t5w2ya \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ek_..." \
  -d '{"folder": "/root/reports"}'
AnswerWhen
200 and the answerIt worked.
400 with "error" and "missing"An input is missing or the wrong kind.
401The endpoint needs its key, or the key is wrong.
404There is no endpoint at that address.
429More calls this minute than the endpoint allows, or your plan has no queries left today.
503The owner switched the endpoint off.

Same rules as the app

An endpoint runs the app's own command through the Ocalt gateway, exactly as the app does. Each endpoint has its own key that reaches that one command of that one app and nothing else, so the business roles, storage choices and plan limits that apply in the app apply to every call. Each call uses your queries, the same as using the app.

  • Inputs that decide what runs or where, such as a shell command for a machine or the machine a model runs on, are set by you and can never be sent by a caller.
  • Values a caller sends are always inserted as text, never as code.
  • See the OcaltQL shows the script every call runs, ready to open in the OcaltQL Console.
  • Removing an endpoint stops its address at once and revokes its key.

Your own AI, as an API

A model you run in Olde, in Local Split mode, can get an address that answers like any AI platform's chat API: send messages, get a chat completion back. In Olde, open the running model and press Give it an API address.