Official SDKs

Integrate Enprompta into your applications with our official SDKs. Choose the one that fits your stack.

TypeScript SDK

@enprompta/sdk
View Docs

Auto-instrument OpenAI, Anthropic & Gemini, serve versioned prompts, and ship traces — with middleware, retries, and full type safety.

Auto-InstrumentationType SafetyMiddleware SystemOAuth2 Support
npm install @enprompta/sdk

Python SDK

enprompta
View Docs

Auto-instrument OpenAI, Anthropic & Gemini in one call, plus an async-first client built on httpx with pydantic models.

Auto-InstrumentationAsync/AwaitPydantic ModelsSync Wrapper
pip install enprompta

Quick Comparison

FeatureTypeScriptPython
API Key AuthYesYes
OAuth2 AuthYesYes
Automatic RetryYes (6 strategies)Yes
Middleware SystemYes (extensible)Yes (basic)
Type SafetyFull TypeScriptType hints + Pydantic
Async SupportNative async/awaitAsync + Sync wrapper
Auto-paginationAsync generatorsAsync generators
Minimum RuntimeNode.js 18+Python 3.8+

Quick Start

TypeScriptFull docs →
import { Enprompta } from '@enprompta/sdk'

const client = new Enprompta({
  apiKey: process.env.ENPROMPTA_API_KEY
})

const prompts = await client.prompts.list()

const result = await client.prompts.execute(
  'prompt_id',
  {
    variables: { name: 'World' },
    provider: 'openai',
    model: 'gpt-4'
  }
)
from enprompta import Enprompta

client = Enprompta(
    api_key=os.environ["ENPROMPTA_API_KEY"]
)

prompts = await client.prompts.list()

result = await client.prompts.execute(
    "prompt_id",
    variables={"name": "World"},
    provider="openai",
    model="gpt-4"
)

Text vs structured prompts

A prompt can be authored two ways. Most start as text and move to structured when they need a separate system instruction or distinct roles. Modern chat models treat the system role specially, so keeping it separate from the user template produces better, more predictable behaviour than flattening everything into one message.

TypeAuthored asServed asUse when
Text (Simple)One prompt bodycontent stringA single instruction or template
StructuredSystem + User messagesmessages (roles) + composed contentSeparate system instructions or roles

The runtime fetch always returns content (for a structured prompt it's the System and User text composed together, so existing integrations keep working) and messages (the structured form, or null for a text prompt). Prefer messages when present:

const p = await client.prompts.getLive('summariser', { label: 'prod' })

// Works for both prompt types:
const messages = p.messages ?? [{ role: 'user', content: p.content }]
await openai.chat.completions.create({ model: 'gpt-4o', messages })
Official SDKs - Enprompta