Midas Code API is now in public beta. Get started free
Everything you need to integrate Midas Code into your workflow.
Everything you need to make your first API call. Authentication, request format, and a working example in 5 minutes.
Complete reference for every endpoint, parameter, response format, and error code in the Midas Code API.
Official client libraries with full TypeScript types, retry logic, and streaming support built in.
Real-world code examples showing common integration patterns, from simple single-file scripts to full-stack applications.
From zero to your first code generation in under five minutes.
Sign up for a free Midas Code account. No credit card required to get started.
Sign up freeAfter signing in, navigate to your dashboard and generate an API key from the API Keys section.
Go to dashboardUse the key in the Authorization header of a POST request to /api/agent/prompt. See the example below.
Try the Context Engine, Agents API, and SDK integrations to unlock the full Midas Code platform.
Explore toolsMake your first API call in under 60 seconds.
Request
curl -X POST https://api.midascode.net/api/agent/prompt \
-H "Authorization: Bearer midas_your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "midas-2",
"prompt": "Create a rate-limited Express.js middleware",
"language": "typescript",
"context": ""
}'Response
{
"id": "gen_01jxk8m2s4f9r",
"model": "midas-2",
"language": "typescript",
"code": "import rateLimit from 'express-rate-limit';\n\nexport const rateLimiter = rateLimit({\n windowMs: 15 * 60 * 1000,\n max: 100,\n message: { error: 'Too many requests' },\n});",
"tokens": 87,
"latency_ms": 620
}All available endpoints. Authenticate requests using Authorization: Bearer midas_your_key.
/api/auth/send-codeSend a one-time login code to an email address./api/auth/verifyVerify the OTP and issue a session token./api/user/meReturn the authenticated user's profile and credits./api/agent/promptSubmit a code generation prompt and receive a response./api/agent/sessionsList all agent sessions for the current user./api/credits/packagesReturn available credit packages and their prices./api/credits/purchaseInitiate a credit purchase for the current user./api/token-gate/checkCheck whether a wallet holds a required token./api/usage/statsReturn aggregated usage statistics for the current user.Client libraries with full TypeScript types, retry logic, and streaming support out of the box.
Tutorials, best practices, and integration patterns to help you get the most out of Midas Code.