Run the editing agent
POST
https://api.vidmoat.com/v1/ai/agentDescribe an edit in message and let the agent emit and apply the commands. One turn per call, charged once: you drive the loop. Works on every plan.
Body#
projectIdstringrequiredThe project to edit.messagestringrequiredThe edit, in plain words. Up to 2,000 characters.dryRunbooleandefaultfalseReturn the planned commands without applying them.
Response#
Returns 200.
Response fields#
projectIdstringThe project.appliedbooleanWhether the commands were saved.plannerstringWhich model planned the turn.messagestringThe agent's reply.commandsarrayThe commands it planned.resultsarrayOne entry per command:{ op, ok, error?, data? }. A failed command is reported here, not as an HTTP error.verificationobjectWhat happened:accepted(count),failed([{ op, error }]),blocked,layoutwarnings, andoutcome(executed,needs-repairorblocked).lintarrayLayout warnings:{ severity: "warn" | "note", time, message }.suggestedPreviewTimesarray of numbersTimestamps worth looking at with the preview endpoint before you render.projectobjectThe project after the turn, summary view.creditsobject{ charged, remaining }: what this call cost and the balance after it.
Errors#
Besides the errors any request can get (authentication, rate limits):
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | message or projectId is missing. |
| 404 | not_found | No such project, or it is not yours. The two are indistinguishable on purpose. |
| 402 | insufficient_credits | The balance cannot cover the call. Nothing ran. remaining is the balance. |
| 422 | prompt_rejected | The prompt failed the safety check. Nothing was charged. field names the field. |
| 502 | provider_error | No planner answered. The charge is refunded. |