> 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.

# Find model prices

GET http://localhost:5173/api/v1/private/model-prices

The organization's price rows and the list version; an empty list at version 0 when the workspace has no organization

Reference: https://www.comet.com/docs/opik/reference/rest-api/model-prices/find-model-prices

## Servers

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

## Response

### 200

Model prices

- `version` (long, optional) — Raised by every saved change; send it back as expected_version
- `rows` (list of CustomModelPriceRow, optional)

## Errors

### 503 Service Unavailable Error

Custom model prices are disabled, or the organization could not be looked up

- `code` (integer, optional)
- `message` (string, optional)
- `details` (string, optional)

## Types

### CustomModelPriceRow

One of the organization's price rows, in the shape the replace endpoint accepts back

- `id` (string, optional)
- `model` (string, optional)
- `provider` (string, optional) — Empty means any provider
- `kind` (enum, optional)
  - Allowed values: `fixed`, `alias`
- `input_price` (string, optional) — USD per 1M input tokens; absent means the built-in rate
- `output_price` (string, optional) — USD per 1M output tokens; absent means the built-in rate
- `cache_read_price` (string, optional) — USD per 1M cached input tokens read; absent means the built-in rate
- `cache_write_price` (string, optional) — USD per 1M input tokens written to the cache; absent means the built-in rate
- `alias_of` (CustomModelPriceAliasOf, optional)
- `note` (string, optional)
- `created_at` (datetime, optional)
- `created_by` (string, optional)
- `last_updated_at` (datetime, optional)
- `last_updated_by` (string, optional)

### CustomModelPriceAliasOf

- `model` (string, optional)
- `provider` (string, optional) — Empty means the span's own provider

## Examples

**Response**

```json
{
  "version": 1,
  "rows": [
    {
      "id": "string",
      "model": "string",
      "provider": "string",
      "kind": "fixed",
      "input_price": "1.25",
      "output_price": "10",
      "cache_read_price": "string",
      "cache_write_price": "string",
      "alias_of": {
        "model": "string",
        "provider": "string"
      },
      "note": "string",
      "created_at": "2024-01-15T09:30:00Z",
      "created_by": "string",
      "last_updated_at": "2024-01-15T09:30:00Z",
      "last_updated_by": "string"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "http://localhost:5173/api/v1/private/model-prices"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'http://localhost:5173/api/v1/private/model-prices';
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/model-prices"

	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/model-prices")

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/model-prices")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://localhost:5173/api/v1/private/model-prices');

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

```csharp
using RestSharp;

var client = new RestClient("http://localhost:5173/api/v1/private/model-prices");
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/model-prices")! 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()
```