Midas Code API is now in public beta. Get started free

PricingDocs
Tools / Midas SDK

Midas SDK

Quick-start code generation with any language.

Official client libraries for Python and TypeScript with first-class support for Go, Rust, and more. Get started in minutes.

Supported languages

Native client libraries for popular languages. REST API for everything else.

Python
TypeScript / JavaScript
Go
Rust
Java
C#
Ruby
PHP

Start in minutes

PythonInstall and use in 30 seconds

pip install midascode
import midascode

client = midascode.Client(api_key="midas_your_key")

# Generate code from a prompt
response = client.generate(
    prompt="Create a FastAPI endpoint for user authentication",
    language="python",
    context=open("app/main.py").read()
)

print(response.code)

TypeScriptWith streaming support

npm install @midascode/sdk
import { MidasCode } from "@midascode/sdk";

const client = new MidasCode({ apiKey: process.env.MIDAS_API_KEY });

// Stream the generated code in real time
const stream = await client.generate.stream({
  prompt: "Create a React hook for pagination",
  language: "typescript",
});

for await (const chunk of stream) {
  process.stdout.write(chunk.delta);
}

Designed to get out of your way

The SDK handles retries, rate limiting, authentication, and streaming. You focus on what you are building.

  • Single dependency, no sub-dependencies
  • Fully typed with TypeScript definitions and Python stubs
  • Streaming support via async iterators
  • Retry logic and exponential backoff built in
  • Compatible with any HTTP client or framework
  • Environment variable configuration with sensible defaults

Configure once, use everywhere

# .env
MIDAS_API_KEY=midas_your_key
MIDAS_MODEL=midas-2
MIDAS_TIMEOUT=30

# The SDK picks these up automatically
import midascode
client = midascode.Client()  # no args needed
Midas Code platform

Start building with the Midas SDK

Install in one command. Full documentation and examples available in our docs.