> For the complete documentation index, see [llms.txt](https://ocx.gitbook.io/ocx-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ocx.gitbook.io/ocx-doc/ocx/getting-started/connect-wallet.md).

# connect wallet

OCX uses **Sign-In With Ethereum (SIWE)** for authentication — there are no passwords. Your wallet is your identity.

## Supported wallets

Any EVM-compatible wallet that supports EIP-4361 message signing works with OCX. This includes:

* MetaMask
* Rabby
* Coinbase Wallet
* WalletConnect-compatible wallets
* Rainbow

## Connecting through the UI

{% stepper %}
{% step %}
Visit [api.ocx.global](https://api.ocx.global/) and click **Connect**.
{% endstep %}

{% step %}
Select your wallet from the RainbowKit dialog.
{% endstep %}

{% step %}
When prompted, **sign the SIWE message**. This is a gas-free off-chain signature — it proves you control the wallet and logs you in.
{% endstep %}

{% step %}
A secure session cookie is set. You stay logged in for 7 days.
{% endstep %}
{% endstepper %}

## Signing out

Click your address in the header and choose **Sign out**, or call `POST /auth/logout`. This revokes the current session immediately.

## Connecting programmatically

If you're integrating from a bot or backend, call the SIWE endpoints directly:

```http
POST /auth/nonce
Content-Type: application/json

{ "walletAddress": "0xYourAddress" }
```

Response:

```json
{ "nonce": "abc123..." }
```

Construct a SIWE message using that nonce, sign it with your wallet's private key (libraries like `viem`, `ethers`, and the official `siwe` npm package do this for you), then submit:

```http
POST /auth/siwe
Content-Type: application/json

{
  "message": "full SIWE message text",
  "signature": "0x..."
}
```

The response sets a session cookie. Subsequent requests should include the cookie (or the raw JWT as a `Authorization: Bearer` token).

For the full SIWE API contract, see [Authentication → Sign-In With Ethereum](file:///7302513/authentication/siwe.md).

## Using API keys instead

Once you're signed in, you can **create API keys** from the Portfolio → API Keys tab. API keys are the recommended way to authenticate bots and long-running integrations — they don't expire with your session and can be scoped and IP-restricted. See [Authentication → API Keys](file:///7302513/authentication/api-keys.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ocx.gitbook.io/ocx-doc/ocx/getting-started/connect-wallet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
