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

# API Overview

> Getting started with the usmewe API

# API Reference

The usmewe API provides programmatic access to all platform features.

## Base URL

<Tabs>
  <Tab title="Production">
    ```
    https://api-production-2d08.up.railway.app/v1
    ```
  </Tab>

  <Tab title="Staging">
    ```
    https://api-staging.usmewe.com/v1
    ```
  </Tab>
</Tabs>

## Authentication

All API requests require authentication via JWT token:

```bash theme={null}
curl -X GET "https://api.usmewe.com/v1/users/me" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
```

<Card title="Authentication Guide" icon="key" href="/developers/api-reference/authentication">
  Learn how to obtain and use JWT tokens
</Card>

## Rate Limits

| Tier       | Requests/min | Requests/day |
| ---------- | ------------ | ------------ |
| Free       | 60           | 1,000        |
| Pro        | 300          | 10,000       |
| Enterprise | Unlimited    | Unlimited    |

Rate limit headers are included in all responses:

```
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1704067200
```

## Response Format

All responses are JSON with consistent structure:

### Success Response

```json theme={null}
{
  "success": true,
  "data": {
    // Response data
  },
  "meta": {
    "timestamp": "2025-01-15T12:00:00Z",
    "requestId": "req_abc123"
  }
}
```

### Error Response

```json theme={null}
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid amount",
    "details": {
      "field": "amount",
      "reason": "Must be greater than 0"
    }
  },
  "meta": {
    "timestamp": "2025-01-15T12:00:00Z",
    "requestId": "req_abc123"
  }
}
```

## Error Codes

| Code               | HTTP Status | Description              |
| ------------------ | ----------- | ------------------------ |
| `UNAUTHORIZED`     | 401         | Invalid or missing token |
| `FORBIDDEN`        | 403         | Insufficient permissions |
| `NOT_FOUND`        | 404         | Resource not found       |
| `VALIDATION_ERROR` | 400         | Invalid request data     |
| `RATE_LIMITED`     | 429         | Too many requests        |
| `INTERNAL_ERROR`   | 500         | Server error             |

## API Sections

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/developers/api-reference/authentication">
    OAuth, tokens, sessions
  </Card>

  <Card title="Users" icon="user" href="/developers/api-reference/users">
    Profiles, settings, XP
  </Card>

  <Card title="Trust Score" icon="star" href="/developers/api-reference/trust-score">
    Score queries, history
  </Card>

  <Card title="Loans" icon="handshake" href="/developers/api-reference/loans">
    P2P loan operations
  </Card>

  <Card title="Vault" icon="vault" href="/developers/api-reference/vault">
    Staking, borrowing, yield
  </Card>

  <Card title="Social Vault" icon="shield" href="/developers/api-reference/social-vault">
    Guardians, timelock
  </Card>

  <Card title="Notifications" icon="bell" href="/developers/api-reference/notifications">
    Push notifications
  </Card>

  <Card title="Webhooks" icon="webhook" href="/developers/api-reference/webhooks">
    Event subscriptions
  </Card>
</CardGroup>

## SDKs

We provide official SDKs for common platforms:

<CardGroup cols={2}>
  <Card title="JavaScript/TypeScript" icon="js" href="/developers/sdks/javascript">
    Node.js and browser support
  </Card>

  <Card title="React Hooks" icon="react" href="/developers/sdks/react-hooks">
    Ready-to-use React hooks
  </Card>
</CardGroup>

## OpenAPI Specification

Download our OpenAPI 3.0 spec for code generation:

```bash theme={null}
curl -O https://api.usmewe.com/v1/openapi.json
```

<Card title="Swagger UI" icon="swagger" href="https://api.usmewe.com/docs">
  Interactive API documentation
</Card>
