> ## Documentation Index
> Fetch the complete documentation index at: https://docs.centosfi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get up and running with Centos Finance in 5 minutes

## 1. Create an Account

Sign up at [app.centosfi.com](https://app.centosfi.com) to create your account.

## 2. Generate an API Key

1. Log in to your dashboard
2. Navigate to **Settings → API Keys**
3. Click **Create API Key**
4. Copy and securely store your key — it will only be shown once

## 3. Install Required Packages

```python theme={null}
pip install requests
```

## 4. Make Your First Request

Test your API key by searching for markets. We support ticker search (Kalshi ticker, Polymarket condition\_id/slug, centos\_id) and fuzzy search ("bitcoin", "fed rates").

```python theme={null}
import requests

API_KEY = "your_api_key"
BASE_URL = "https://api.centosfi.com/v1"

headers = {"x-api-key": API_KEY}

# Search for shutdown related markets on Polymarket
response = requests.get(
    f"{BASE_URL}/markets/search",
    headers=headers,
    params={"q": "shutdown", "exchange": "POLYMARKET"}
)
for market in response.json()["results"]:
    print(f"Centos ID: {market['centos_id']}, Ticker: {market['slug']}")
```

## 5. Set Up a Subaccount

Subaccounts let you organize trading activity into separate containers — useful for segregating strategies, clients, or portfolios.

You can create them via the UI at **Settings → Subaccounts** or programmatically:

```python theme={null}
response = requests.post(
    f"{BASE_URL}/subaccounts",
    headers=headers,
    json={"name": "My Trading Account"}
)
subaccount = response.json()
subaccount_id = subaccount["subaccount_id"]
```

<Tip>
  Watch the [video walkthrough](https://www.loom.com/embed/9b49e269c09e436d98b72f3cb55d7691) to see how to create a subaccount, add a Polymarket account, and place your first trade.
</Tip>

## 6. Add Exchange Credentials

Exchange credentials can be added via the UI under **Settings → Subaccounts**

<Note>
  We use asymmetric encryption — your credentials are never transferred between services or stored in plain text. Credentials are deleted when you delete a subaccount.
</Note>

TODO : linkj

## 7. Place Your First Order

Use the Centos ID from your market search to place an order:

```python theme={null}
response = requests.post(
    f"{BASE_URL}/orders",
    headers=headers,
    json={
        "subaccount_id": subaccount_id,
        "centos_id": 4552150,       # From market search
        "order_type": "LIMIT",      # LIMIT or MARKET
        "time_in_force": "GTC",     # FOK, GTC, GTD, or IOC
        "buy_flag": True,           # True=buy, False=sell
        "price": 0.50,              # Limit price (0-1)
        "qty": 10,                  # Number of contracts
    }
)
order = response.json()
print(f"Order placed: {order['centos_order_id']}")
```

## 8. Check Order Status

```python theme={null}
order_id = order['centos_order_id']
response = requests.get(
    f"{BASE_URL}/orders/{order_id}",
    headers=headers
)
order_status = response.json()
print(f"Status: {order_status['status']}, Filled: {order_status['traded_qty']}/{order_status['qty']}")
```

Possible statuses:

| Status               | Description                          |
| -------------------- | ------------------------------------ |
| `pending_submission` | Order received, awaiting processing  |
| `submitted`          | Order sent to exchange               |
| `partially_filled`   | Order partially executed             |
| `filled`             | Order fully executed                 |
| `cancelled`          | Order cancelled                      |
| `rejected`           | Order rejected (see `reject_reason`) |

## 9. Cancel an Order

```python theme={null}
order_id = order['centos_order_id']
response = requests.delete(
    f"{BASE_URL}/orders/{order_id}",
    headers=headers
)
if response.status_code == 202:
    print(response.json())
```

<Warning>
  Only orders with status `submitted` or `partially_filled` can be cancelled.
</Warning>

## Rate Limits

* **Standard**: 100 requests/minute
* **Premium**: Contact support for higher limits
