# Quickstart Make your first PrivateMind API request in five minutes. You need an API key and `curl`. The examples also show Python and TypeScript. ## 1. Get an API key Sign in to PrivateMind, open **API Keys** in the sidebar, and click **Create key**. Give it a name, set a budget cap, and copy the secret immediately. It isn't shown again. A key has two parts: ```text PMIND...:... ``` The part before the colon is the key ID, which starts with `PMIND`. The part after it is the secret. You send the whole string as the bearer token. ## 2. Set your key Every example on this site uses the base URL `https://api.privatemind.com`. ```bash export PMIND_KEY='PMIND...:...' ``` ## 3. List models ```bash curl -s "https://api.privatemind.com/v1/models" \ -H "Authorization: Bearer $PMIND_KEY" \ | jq '.data[] | {id, context_length, supported_parameters}' ``` You see only the models your organisation can call. Pick an id for the next step. ## 4. Make a chat completion > [!TIP] > This example uses the `fast` alias, which points to the most efficient model in your environment. [Models](https://docs.privatemind.com/models.html) lists the other aliases. **cURL** ```bash curl -s "https://api.privatemind.com/v1/chat/completions" \ -H "Authorization: Bearer $PMIND_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "fast", "messages": [{"role": "user", "content": "Summarise CAP theorem in one sentence."}] }' ``` **Python** ```python from openai import OpenAI client = OpenAI(base_url="https://api.privatemind.com/v1", api_key=PMIND_KEY) resp = client.chat.completions.create( model="fast", messages=[{"role": "user", "content": "Summarise CAP theorem in one sentence."}], ) print(resp.choices[0].message.content) ``` **TypeScript** ```typescript import OpenAI from 'openai'; const client = new OpenAI({ baseURL: `https://api.privatemind.com/v1`, apiKey: process.env.PMIND_KEY, }); const resp = await client.chat.completions.create({ model: 'fast', messages: [{ role: 'user', content: 'Summarise CAP theorem in one sentence.' }], }); console.log(resp.choices[0].message.content); ``` You get back a standard OpenAI `chat.completion` object. The answer is in `choices[0].message.content` and the token counts are in `usage`. > [!TIP] > Any OpenAI SDK that takes a base URL works unchanged, including the official Python, Node and Go SDKs. Set the base URL to `https://api.privatemind.com/v1` and use your PMIND key as the API key. [OpenAI SDK](https://docs.privatemind.com/openai-sdk.html) shows what's supported. ## Or use the Anthropic shape The same key and models also answer the Anthropic Messages API. Point an Anthropic SDK at `https://api.privatemind.com`, without `/v1`: ```python import anthropic client = anthropic.Anthropic(base_url="https://api.privatemind.com", api_key=PMIND_KEY) message = client.messages.create( model="fast", max_tokens=400, messages=[{"role": "user", "content": "Summarise CAP theorem in one sentence."}], ) print(next(b.text for b in message.content if b.type == "text")) ``` See [Messages API](https://docs.privatemind.com/messages-api.html) and [Anthropic SDK](https://docs.privatemind.com/anthropic-sdk.html). ## Where next - [Stream responses](https://docs.privatemind.com/streaming.html) for token-by-token output - [Call tools](https://docs.privatemind.com/tool-use.html) for function-calling round-trips - [Embed text](https://docs.privatemind.com/embeddings.html) for search and retrieval - [Use the OpenAI SDK](https://docs.privatemind.com/openai-sdk.html) directly - [Use the Anthropic SDK](https://docs.privatemind.com/anthropic-sdk.html), or [Claude Code](https://docs.privatemind.com/coding-agents.html#claude-code)