> This page is for Gateway.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# List customers

GET https://api-gateway.merge.dev/v1/customers

Reference: https://docs.merge.dev/merge-gateway/embedded-routing/customers/list-customers

## Authentication

- `Authorization` header (bearer token, required) — Your production key sent as a bearer token.

## Request

### Query parameters

- `cursor` (string, optional)
- `origin_id` (string, optional) — Look up a customer by your own ID: returns the customer whose origin_id matches, so you can resolve it to the Merge UUID without storing the mapping.
- `limit` (integer, optional, default: 20) — Customers per page, 1 to 100.

## Response

### 200

Successful Response

- `results` (list of Customer, optional)
- `next` (string, optional, nullable)
- `previous` (string, optional, nullable)

## Types

### Customer

- `id` (string, optional) — Merge UUID. Use as customer at request time.
- `origin_id` (string, optional) — Your unique id for the customer (immutable).
- `name` (string, optional)
- `routing_policies` (list of string, optional) — Array of the customer's routing policy UUIDs.
- `budgets` (list of string, optional) — Array of the customer's budget UUIDs.
- `byok_configurations` (list of string, optional) — Array of the customer's provider key UUIDs.
- `key_usage_default` (enum, optional) — CUSTOMER_ONLY uses only the customer's own keys: never your organization's, never Merge-managed.
  - Allowed values: `USE_ANY`, `PREFER_BYOK`, `BYOK_ONLY`, `CUSTOMER_ONLY`
- `status` (enum, optional) — An inactive customer's requests are rejected.
  - Allowed values: `ACTIVE`, `INACTIVE`
- `created_at` (datetime, optional)
- `modified_at` (datetime, optional)

## Examples

**Response**

```json
{
  "results": [
    {
      "id": "9f8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
      "origin_id": "acme-corp",
      "name": "Acme",
      "routing_policies": [
        "2a1b3c4d-5e6f-4708-9a0b-1c2d3e4f5a6b"
      ],
      "budgets": [
        "7c6d5e4f-3a2b-4c1d-8e9f-0a1b2c3d4e5f"
      ],
      "byok_configurations": [
        "5e4f3a2b-1c0d-4e9f-8a7b-6c5d4e3f2a1b"
      ],
      "key_usage_default": "USE_ANY",
      "status": "ACTIVE",
      "created_at": "2026-07-01T12:00:00Z",
      "modified_at": "2026-07-01T12:00:00Z"
    }
  ],
  "next": "string",
  "previous": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api-gateway.merge.dev/v1/customers"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api-gateway.merge.dev/v1/customers';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api-gateway.merge.dev/v1/customers"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api-gateway.merge.dev/v1/customers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api-gateway.merge.dev/v1/customers")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-gateway.merge.dev/v1/customers', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api-gateway.merge.dev/v1/customers");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway.merge.dev/v1/customers")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```