# Quickstart

# Quickstart

Three steps: get a key, point at the base URL, send a request.

## 1. Get a key

Keys come from the **Hyphen console**:

1. Go to **[app.hyphen-solution.com](https://app.hyphen-solution.com)** and sign
   in.
2. Open **Dashboard → API Keys → Create**.
3. Copy the key — it looks like `sk-hy-...`.

One key authenticates every endpoint. Keep it secret — treat it like a password.
Export it into your shell so the samples below pick it up:

```bash
export HYPHEN_API_KEY="sk-hy-..."
```

## 2. Set the base URL

The gateway root is:

```
https://api.hyphen-solution.com
```

OpenAI-style clients want the `/v1` root:

```
https://api.hyphen-solution.com/v1
```

## 3. Make your first request

A minimal Chat Completions call with `curl` — this returns a completion from the
strongest model, `m3`:

```bash
curl https://api.hyphen-solution.com/v1/chat/completions \
  -H "Authorization: Bearer $HYPHEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "m3",
    "messages": [
      { "role": "user", "content": "Say hello in one sentence." }
    ]
  }'
```

You'll get back an OpenAI-shaped response:

```json
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "model": "m3",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Hello — great to meet you!" },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 12, "completion_tokens": 8, "total_tokens": 20 }
}
```

If you see a `choices[0].message.content`, you're connected.

### Same call, OpenAI SDK

```python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.hyphen-solution.com/v1",
    api_key="sk-hy-...",  # your Hyphen key
)

resp = client.chat.completions.create(
    model="m3",
    messages=[{"role": "user", "content": "Say hello in one sentence."}],
)
print(resp.choices[0].message.content)
```

```typescript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.hyphen-solution.com/v1",
  apiKey: "sk-hy-...", // your Hyphen key
});

const resp = await client.chat.completions.create({
  model: "m3",
  messages: [{ role: "user", content: "Say hello in one sentence." }],
});
console.log(resp.choices[0].message.content);
```

## Check which models you have

```bash
curl https://api.hyphen-solution.com/v1/models \
  -H "Authorization: Bearer $HYPHEN_API_KEY"
```

```json
{
  "object": "list",
  "data": [
    { "id": "m2.5", "object": "model", "owned_by": "hyphen" },
    { "id": "m2.7", "object": "model", "owned_by": "hyphen" },
    { "id": "m3", "object": "model", "owned_by": "hyphen" },
    { "id": "text", "object": "model", "owned_by": "hyphen" }
  ]
}
```

Pick a model by tier — fast/cheap `m2.5`, balanced `m2.7`, strongest `m3`, plain
`text`. See [Models](/models) for detail.

## What happens at the cap

When your key's monthly budget is spent, requests fail closed with **HTTP 429**
instead of running over budget:

```json
{
  "error": {
    "message": "Budget has been exceeded! Monthly budget resets on 2026-08-01.",
    "type": "budget_exceeded",
    "code": "429"
  }
}
```

No overage is ever charged. Full details on [Rate limits & caps](/rate-limits).

## Where to go next

- **[Connect your coding agent](/agents/claude-code)** — one page per tool, each
  a single copy-paste block.
- **[API Reference](/api)** — try every endpoint interactively.
