---
title: "Quickstart"
subtitle: "Create a prompt, deploy it, and call it by ID through the gateway."
---

Keep prompts in Respan instead of in your code. Your app calls a prompt by its ID, and when you deploy a new version, the next call uses it with no code change.

<Steps>
<Step title="Create a prompt">

In the [platform](https://platform.respan.ai), go to **Gateway** › **Prompts** and click **New prompt** (or press **C**). Respan creates **Untitled prompt** and opens it in the editor. To rename it, hover its tab and click the pencil.

</Step>
<Step title="Write the messages">

Fill in the **System** and **User** messages. Wrap anything that changes per request in double braces, like `{{customer_name}}`. Each variable gets a field in the **Variables** tab. Click **Add message** to add more turns.

<img src={"/docs/images/prompts/prompt-editor-light.png"} className="block dark:hidden" alt="The prompt editor with a System message, a User message using the variables customer_name, plan, and ticket_body, and the Variables tab with a test value for each" />
<img src={"/docs/images/prompts/prompt-editor-dark.png"} className="hidden dark:block" alt="The prompt editor with a System message, a User message using the variables customer_name, plan, and ticket_body, and the Variables tab with a test value for each" />

</Step>
<Step title="Pick a model and test">

Click **Open side panel** (the icon at the top right), or press **.**:

- **Settings**: choose the **Model** and tune **Model settings** such as temperature and max tokens.
- **Variables**: enter a test value for each variable.

Click **Run** (**⌘ ↵**). The reply shows in the **Test run** tab.

</Step>
<Step title="Commit and deploy">

Click **Commit** (**⌘ S**), type a message (or press **Tab** to generate one), and click **Commit + Deploy**. **Commit** alone saves a version without making it live.

<img src={"/docs/images/prompts/commit-dialog-light.png"} width="420" className="block dark:hidden" alt="The Commit dialog with a commit message and two buttons: Commit + Deploy and Commit" />
<img src={"/docs/images/prompts/commit-dialog-dark.png"} width="420" className="hidden dark:block" alt="The Commit dialog with a commit message and two buttons: Commit + Deploy and Commit" />

Respan shows **Your prompt was deployed** with the **Prompt ID**. Copy it. To find it later, click the copy icon next to the prompt name in the side panel and choose **Copy ID**.

</Step>
<Step title="Call the prompt">

Send a `prompt` object with the prompt ID and your variables. Respan fills the variables into the deployed version and uses that version's messages, model, and settings. You need a Respan API key and credits or a provider key; see the [Gateway quickstart](/docs/ai-gateway/quickstart).

<Tabs>
<Tab title="OpenAI (Python)">
```python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.respan.ai/api/",
    api_key=os.environ["RESPAN_API_KEY"],
)

response = client.chat.completions.create(
    model="gpt-5.5",  # the prompt's saved model is used
    messages=[],
    extra_body={
        "prompt": {
            "prompt_id": "YOUR_PROMPT_ID",
            "schema_version": 2,
            "variables": {
                "customer_name": "Maya Patel",
                "plan": "Team",
                "ticket_body": "Reset link opens a blank page.",
            },
        }
    },
)
print(response.choices[0].message.content)
```
</Tab>
<Tab title="OpenAI (TypeScript)">
```typescript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.respan.ai/api/",
  apiKey: process.env.RESPAN_API_KEY,
});

const response = await client.chat.completions.create({
  model: "gpt-5.5", // the prompt's saved model is used
  messages: [],
  // @ts-expect-error `prompt` is a Respan field
  prompt: {
    prompt_id: "YOUR_PROMPT_ID",
    schema_version: 2,
    variables: {
      customer_name: "Maya Patel",
      plan: "Team",
      ticket_body: "Reset link opens a blank page.",
    },
  },
});
console.log(response.choices[0].message.content);
```
</Tab>
<Tab title="cURL">
```bash
curl https://api.respan.ai/api/chat/completions \
  -H "Authorization: Bearer $RESPAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": {
      "prompt_id": "YOUR_PROMPT_ID",
      "schema_version": 2,
      "variables": {
        "customer_name": "Maya Patel",
        "plan": "Team",
        "ticket_body": "Reset link opens a blank page."
      }
    }
  }'
```
</Tab>
</Tabs>

To see the calls, click **Logs** next to the prompt's tab at the top (or press **L**). Logs opens filtered to this prompt.

</Step>
</Steps>

## Ship a new version

Edit the prompt and click **Commit + Deploy** again. Your app gets the new version on its next call.

To see every version, click the version count at the top right (like **3 versions**), or press **H**. The live version is tagged **Deployed**, and edits you haven't committed show as **Draft**. To roll back, select an older version and click **Deploy**.

<img src={"/docs/images/prompts/versions-pane-light.png"} width="420" className="block dark:hidden" alt="The versions pane: the current draft (v3), the deployed version (v2), and an older version (v1), each with its commit message and author" />
<img src={"/docs/images/prompts/versions-pane-dark.png"} width="420" className="hidden dark:block" alt="The versions pane: the current draft (v3), the deployed version (v2), and an older version (v1), each with its commit message and author" />

## Choose which version a call uses

Add `version` to the `prompt` object:

| `version` | The call uses |
| --- | --- |
| Not set | The deployed version |
| A number, like `3` | That version |
| `"latest"` | The newest version, including an uncommitted draft |

With `"schema_version": 2`, the prompt's saved settings win over the request body, and any `messages` you send are added after the prompt's messages. For the older `override` behavior, `patch`, and the versioning API, see [Advanced configurations](/docs/documentation/features/prompt-management/advanced).

To return JSON, let the model call functions, or reuse one prompt inside another, see [Structured output](/docs/documentation/features/prompt-management/structured-output), [Tool calling](/docs/documentation/features/prompt-management/tool-calling), and [Prompt composition](/docs/documentation/features/prompt-management/prompt-composition). To compare models before you commit, use the [Playground](/docs/documentation/features/prompt-management/playground).

To let someone outside your project view or edit one prompt, [share it with a guest](/docs/documentation/admin/collaborate#share-one-prompt-with-a-guest).
