Skip to main content
PromptFlipdocs

Quickstart

Fetch your first managed prompt in under five minutes. You need an API key and one of the SDKs.

Get an API key

Open Settings from the sidebar user menu and go to the API Keys tab to create one. Keys are prefixed sk_. Treat a key like a password — keep it on your server, never ship it to a browser bundle.

Install an SDK

Pick the SDK for your language:

pip install promptflip

Fetch a prompt

Call get() with a prompt key and an inline fallback. The fallback is what your users see if the service is ever unreachable, so the call is always safe to make on the serving path.

from promptflip import PromptFlip

pm = PromptFlip(api_key="sk_...", environment="prod")

# Always returns a usable Prompt — never throws.
prompt = pm.get(
    "welcome-message",
    fallback="Welcome aboard, [[name]]!",
    inputs={"name": user.name},
)

print(prompt.text)

Report results

Optional, but it powers version comparison and A/B experiments. Wrap your model call in run() and the SDK reports latency and whatever metrics you set:

with prompt.run() as r:
    response = call_your_model(prompt.text)
    # Set the telemetry you want to track:
    r.tokens = response.total_tokens
    r.converted = True          # custom field — any name you choose is tracked as a metric
    r.revenue_usd = 49          # another custom field
# latency is measured for you; on exit, everything you set is sent in one call