---
title: "Authentication"
description: "Get an OAuth2 bearer token for the Wego API, two ways."
---

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

# Authentication

All `/v1` operations require an OAuth2 bearer token from the Wego auth server. Two ways in, both against the auth endpoints declared in the spec's `securitySchemes`.

## Wego CLI

The easiest path. `wego login` runs the browser flow for you and stores the token locally; every CLI command then calls the API as you. See [Wego CLI](/cli).

## Any OAuth2 client

Run the OAuth2 authorization code flow with PKCE against the Wego auth server, then send the access token as `Authorization: Bearer <token>` (RFC 6750).

| Field | Value |
|---|---|
| Authorize URL | `https://auth.wego.com/user-auth/v2/users/oauth/authorize` |
| Token URL | `https://auth.wego.com/user-auth/v2/users/oauth/token` |
| Client ID | `251815b9647317f4895122fd4924b7d44541d8fcc27be528435e3ad9bbf7e1ee` (public, PKCE) |
| Redirect URI | A loopback address you listen on, e.g. `http://127.0.0.1:<port>/callback` (RFC 8252) |
| PKCE | S256 |
| Scopes | `openid profile users` |

Source: https://agents.wego.com/authentication/index.mdx
