First integration path
1
Authenticate
Create an API key, store it as
MAGICA_API_KEY, and send it as
Authorization: Bearer $MAGICA_API_KEY.2
Choose a model
Use the model catalog to select a standalone model and variant.
3
Validate inputs before running
Fetch the model schema before sending user input.
4
Estimate credits
Estimate cost before submitting an expensive job.
5
Start, poll, and handle terminal states
Start the run, save the returned
runId, then poll until the status is
COMPLETED, FAILED, or CANCELED.Endpoint map
Standalone model runs
Use a standalone model
Best for one model call with one input payload, such as text-to-image, image
edit, transcription, or a utility transform.
Common status handling
Most run-start endpoints are asynchronous. Treat a202 Accepted response as “the job was accepted”, not as final output.
runId in your own system. If a client disconnects, you can still resume polling or inspect the run in Magica run history.