Resources

Official SDKs

Use official E2X SDK packages for TypeScript (@e2x/sdk), Python (e2x), and Go (github.com/e2xai/e2x-go) with zero-drift micro-cent accounting, adaptive polling, and HMAC verification.

Official Client Libraries

Visit the SDKs overview page or browse the unified E2XAI/e2x-sdks monorepo for release notes and issue tracking. Every SDK automatically reads E2X_API_KEY from your environment.

LanguagePackageInstall CommandLinks

TypeScript & Node.js

Node.js 18+, Bun, Deno, Edge Workers

@e2x/sdknpm install @e2x/sdk

Python

Python 3.9+ (Sync & AsyncIO, Pydantic v2)

e2xpip install git+https://github.com/E2XAI/e2x-python.git

Go

Go 1.21+ (Pure Standard Library)

github.com/e2xai/e2x-gogo get github.com/e2xai/e2x-go

SDK Usage Across Runtimes

TypeScriptTypeScript (@e2x/sdk)
import { E2X } from '@e2x/sdk';

const client = new E2X(); // reads E2X_API_KEY
const job = await client.run('openai/gpt-image-2.6-sunburst/text-to-image', {
  prompt: 'Editorial architectural concrete pavilion at dusk',
  aspect_ratio: '16:9',
  resolution: '1K',
}, {
  onUpdate: (snap) => console.log(`Progress: ${snap.progress}%`),
});

console.log(job.output?.outputs?.[0]?.url);
PythonPython (e2x)
from e2x import E2X

client = E2X()
job = client.run(
    "openai/gpt-image-2.6-sunburst/text-to-image",
    {
        "prompt": "Editorial architectural concrete pavilion at dusk",
        "aspect_ratio": "16:9",
        "resolution": "1K",
    },
    on_update=lambda j: print(f"Progress: {j.progress}%"),
)
print(job.output_urls[0])
GoGo (github.com/e2xai/e2x-go)
package main

import (
	"context"
	"fmt"
	"github.com/e2xai/e2x-go"
)

func main() {
	ctx := context.Background()
	client, _ := e2x.New()
	job, _ := client.Run(ctx, e2x.RunParams{
		Model: "openai/gpt-image-2.6-sunburst/text-to-image",
		Input: map[string]any{
			"prompt":       "Editorial architectural concrete pavilion at dusk",
			"aspect_ratio": "16:9",
			"resolution":   "1K",
		},
	})
	fmt.Println("Result:", job.OutputURL())
}

SDK Architecture Guarantees

Every official SDK tracks both integer cost_micro_cents and cost_usd, performs adaptive 1s-burst to 2s-steady polling with Retry-After jitter backoff, and includes built-in constant-time HMAC-SHA256 webhook verification.