> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://www.comet.com/docs/opik/llms.txt.

# Get the workspace's OpenRouter region

GET http://localhost:5173/api/v1/private/llm-provider-key/openrouter/region

Get the OpenRouter region the workspace's OpenRouter requests go to, from its OpenRouter provider's base_url or the server's default OpenRouter URL

Reference: https://www.comet.com/docs/opik/reference/rest-api/llm-provider-key/get-open-router-region

## Servers

- `http://localhost:5173/api` (Local server, default)
- `https://www.comet.com/opik/api` (Opik Cloud)

## Response

### 200

OpenRouter region

- `region` (enum, optional) — Where the workspace's OpenRouter requests go: the host of its OpenRouter provider's base_url, or of the server's default OpenRouter URL when it has none. unknown for a host other than openrouter.ai, eu.openrouter.ai or us.openrouter.ai
  - Allowed values: `global`, `eu`, `us`, `unknown`
- `unavailable_decision_models` (list of UnavailableDecisionModel, optional) — Decision models the server refuses for this workspace, each with the region that doesn't serve it: the server's decisions URL region or the workspace's region

## Types

### UnavailableDecisionModel

Decision models the server refuses for this workspace, each with the region that doesn't serve it: the server's decisions URL region or the workspace's region

- `model` (string, optional)
- `region` (enum, optional)
  - Allowed values: `global`, `eu`, `us`, `unknown`

## Examples

**Response**

```json
{
  "region": "global",
  "unavailable_decision_models": [
    {
      "model": "string",
      "region": "global"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "http://localhost:5173/api/v1/private/llm-provider-key/openrouter/region"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'http://localhost:5173/api/v1/private/llm-provider-key/openrouter/region';
const options = {method: 'GET'};

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 := "http://localhost:5173/api/v1/private/llm-provider-key/openrouter/region"

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

	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("http://localhost:5173/api/v1/private/llm-provider-key/openrouter/region")

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

request = Net::HTTP::Get.new(url)

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("http://localhost:5173/api/v1/private/llm-provider-key/openrouter/region")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://localhost:5173/api/v1/private/llm-provider-key/openrouter/region');

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

```csharp
using RestSharp;

var client = new RestClient("http://localhost:5173/api/v1/private/llm-provider-key/openrouter/region");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:5173/api/v1/private/llm-provider-key/openrouter/region")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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()
```