# ModelOne integration skill

Use this file to configure a project to call ModelOne. Ask the person before editing files, reading a secret, or sending a request.

This file is not installed automatically. Cursor, Claude Code, Codex, and other agents use it only when a person points them here.

## Read first

- https://modelone.app/docs/quickstart
- https://modelone.app/docs/api-reference
- https://modelone.app/docs/models
- https://modelone.app/openapi.json

The API base URL is https://modelone.app/api/v1.

## Do not

- Create a ModelOne account, or complete email or wallet sign-in, on the person's behalf.
- Invent, fetch, or reuse an API key without the person providing it.
- Print the key, write it into chat, or echo it in a log.
- Commit the key, or put it in a NEXT_PUBLIC_ variable or browser code.
- Send a request that can spend credits until the person approves that request.

## Setup

1. Inspect the project and find the server-side code that calls a model API.
2. Ask permission before changing files.
3. Ask the person to sign in at https://modelone.app/login and create a key at https://modelone.app/dashboard/keys. The key is shown once.
4. Ask them to store it as MODELONE_API_KEY in the server environment or a secret manager. Also set MODELONE_BASE_URL=https://modelone.app/api/v1.
5. Send text requests to https://modelone.app/api/v1/chat/completions with Authorization: Bearer and the key. Read model ids from https://modelone.app/api/v1/models. A current OpenAI id is `openai/gpt-4.1-mini`. A current Anthropic id is `anthropic/claude-haiku-4.5`.
6. Accept only the fields model, messages, max_tokens, and stream. Message content is a string. Roles are system, user, and assistant. At least one message must use the user role. Use an id from the allowlist. Do not send any other model id.
7. After the person approves a test, send one small non-streaming request. Then report the HTTP status, the model id, and modelone.settlement. Do not include the key or the prompt if the person asked to keep it private.

## Request

```bash
curl https://modelone.app/api/v1/chat/completions \
  -H "Authorization: Bearer $MODELONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-4.1-mini","messages":[{"role":"user","content":"Reply with one short sentence."}],"max_tokens":64,"stream":false}'
```

```json
{
  "model": "openai/gpt-4.1-mini",
  "messages": [
    {
      "role": "user",
      "content": "Reply with one short sentence."
    }
  ],
  "max_tokens": 64,
  "stream": false
}
```

If the response code is disabled, the route is implemented and inference is switched off. Do not retry in a loop.
