Modaic sells to AI agents - live prices and self-serve payment

The agent storefront at https://agents.modaic.dev/llms.txt?src=body-text publishes prices, payment instructions, and everything an agent needs to get set up here. Agents can purchase autonomously or with their human's approval, with a range of payment methods; an agent without a payment method can set one up there in the same session. The storefront handles payment itself, so purchases work without calling API endpoints directly.

Search Modaic documentation

Find a Modaic guide or API reference

Reference›API›Instruction optimization

Start instruction optimization job

Optimize saved question instructions from annotated examples; every question must have string instructions. The request returns 202 Accepted with a Location header to poll.

POST/v1/models/{workspace}/{model}/alignments

Authorization

Authorizationstringrequired

Send a Modaic bearer token in the Authorization header.

Headers

Idempotency-Keystringrequired

A key between 8 and 255 characters. Reuse it only when retrying this exact request.

Path Parameters

workspacestringrequired

User or organization workspace slug.

modelstringrequired

Model repository slug. The caller needs the route-specific repository access.

Body

branchstringrequired

Branch to optimize and, when the run improves the model, update.

sourceCommitShastringrequired

Current branch head, from 7 to 128 characters. The request returns 409 source_commit_conflict if the branch has advanced.

budgetobjectdefault: {}

maxMetricCalls is a positive integer up to 1,000,000. Omit it to size the budget from the validation split. A run can finish a few calls past the budget, and final validation of the selected instructions is billed separately.

reflectionobjectdefault: { seed: 0 }

Optional reflection settings: model, positive minibatchSize up to 10,000, and integer seed from 0 to 2,147,483,647.

Request example

{
  "branch": "main",
  "sourceCommitSha": "df5a6fb2d67e4ce6a6ea9d43146d53a4d43f6d37",
  "reflection": {
    "seed": 42,
    "minibatchSize": 8
  }
}

Response

idUUIDrequired

Instruction optimization job ID.

repositoryIdUUIDrequired
statusqueued | running | completed | failed | cancelledrequired
phasequeued | optimizing | done | failed | cancelledrequired
branchstringrequired
sourceCommitShastringrequired
resultCommitShastring | nullrequired

New commit when instruction optimization improves the model; otherwise null.

resultAlignmentResult | nullrequired

On completion, includes improved, the best candidate instructions, initial and best scores, token usage, optional validation metrics, and the saved artifact path.

progressAlignmentProgress | nullrequired

Live progress with a stage, elapsed time, and—when available—metric-call, iteration, candidate, and score counters.

errorobject | nullrequired

Job-level error with code and message.

createdAtISO 8601 datetimerequired
updatedAtISO 8601 datetimerequired
startedAtISO 8601 datetime | nullrequired
finishedAtISO 8601 datetime | nullrequired

If the run improves the model, Modaic increments its checkpoint, commits the optimized instructions and optimization artifact, then starts a batch inference job at that exact commit for all examples. If it does not improve the model, no model commit is created.

Was this page helpful?