Quickstart

Your first real CSTM-2 API call in under 2 minutes.

1

Get an API key

Register a developer account — just email and name, no password. Your first key (for the family you choose) is issued immediately. Start with CareerLM — it's the most general-purpose family. Already have a CareerStudioMax account? You can also generate keys from careerstudiomax.com/developer instead.

2

Make your first call

Every request needs Authorization: Bearer <your-key>. Pick your language:

curlPythonJavaScript
curl
curl https://api.careerstudiomax.com/api/cstm2/v1/careerlm/chat \
  -H "Authorization: Bearer cstm_lm_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"Write a cover letter opener for a Senior PM role"}]}'
Python — pip install careerstudiomax-cstm2
from cstm2 import CSTM2Client

client = CSTM2Client(api_key="cstm_lm_your_key_here")

result = client.careerlm.chat(
    messages=[{"role": "user", "content": "Write a cover letter opener for a Senior PM role"}]
)
print(result["choices"][0]["message"]["content"])

# Streaming:
def on_chunk(event):
    print(event.get("text", ""), end="", flush=True)

client.careerlm.chat_stream(on_chunk, messages=[{"role": "user", "content": "Draft a resignation letter"}])
JavaScript — npm install @careerstudiomax/cstm2
const { CSTM2Client } = require('@careerstudiomax/cstm2');

const client = new CSTM2Client('cstm_lm_your_key_here');

const { choices } = await client.careerlm.chat({
  messages: [{ role: 'user', content: 'Write a cover letter opener for a Senior PM role' }],
});
console.log(choices[0].message.content);

// Streaming — chatStream is a sibling of chat, not nested under it:
await client.careerlm.chatStream(
  { messages: [{ role: 'user', content: 'Draft a resignation letter' }] },
  (event) => process.stdout.write(event.text || ''),
);
3

Handle errors

Both SDKs throw a typed error with a machine-readable code and HTTP status — never a silent failure.

Python
from cstm2 import CSTM2Client, CSTM2Error

try:
    client.careerembed.embed("some text")
except CSTM2Error as e:
    print(e.code, e.status, str(e))