Developer examples

Start small.
See what happens.

One request, a readable answer, and the token usage returned with it.

Official API examples

The Oathbreaker AI examples repository contains small Python and JavaScript programs plus a Hermes walkthrough. The code is MIT-licensed and maintained for the Oathbreaker service operated by Formacha LLC.

Create an account, add prepaid credit, and create an API key in your console. Set OATHBREAKER_API_KEY in your server or terminal environment. Keep it out of browser applications, source control, and public issue reports.

Get the examples
git clone https://github.com/Oathbreaker-AI/api-examples.git
cd api-examples
bashExample configuration

JavaScript

Use Node.js 22 or newer. The example uses built-in fetch and does not require installing a package. Read the complete JavaScript source before running it.

JavaScript / one paid request
node javascript/hello.mjs
bashExample configuration

Python

Use Python 3.10 or newer. The example uses the standard library. Read the complete Python source before running it.

Python / one paid request
python3 python/hello.py
bashExample configuration

What the examples do

Each sends one non-streaming Chat Completions request using oathbreaker-glm-5.3, low reasoning effort, and a 2,048-token output budget. It prints the completed answer and usage. Reasoning counts toward the output budget.

Running either example with a real key uses prepaid credit. The examples do not retry automatically. If a request times out or reaches its output limit, inspect your usage before sending another request. Review current pricing, errors and retry behavior, and data handling.

The repository tests run both languages against a local fixture server without paid inference. They verify authentication, request format, usage handling, and errors. They do not measure live model quality or latency.

Hermes, streaming, and tools

For an agent, follow the Hermes setup guide. For your own application, use the streaming reference and function-calling reference. Your application validates and executes tools; these introductory examples only request text.

Questions about these examples belong in the public repository. For account or billing questions, email support@oathbreaker.ai.

OATHBREAKERA DECLARATION OF INTENT / 001
BEFORE YOU ENTER

TAKETHEOATH.

Break the default.
Keep your word.

I take this oath to put my power
in service of humanity.

To build with purpose.
To question with courage.
To act with care.

I will not use it to exploit, deceive,
or cause needless harm.

I will respect the rights of others
and take responsibility for what I create.

The power is mine.
The responsibility is mine.