Get Started
Lightchain AI Developer API
The Developer API is an OpenAI-compatible HTTP API for inference on the Lightchain AI network. Any OpenAI SDK works: change the base URL and the API key. Every completion runs as one job on chain: a worker serves it, the result is committed on chain, and the response names the job.How a call works
CodeHTML
- Your app calls
/v1/chat/completionswith an API key, exactly as it would call OpenAI. - The API picks a free session with a worker for that model, or opens one, and submits the call as a job on chain.
- The job's fee is paid in LCAI from your prepaid balance in the
JobRegistrycontract: by the API, under an on-chain allowance you gave it, or by a payment the call carries itself. - The worker answers. The API decrypts the answer and returns it in OpenAI's shape, with a
lightchainobject naming the job, so you can check it on chain.