> ## Documentation Index
> Fetch the complete documentation index at: https://openrouter.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Providers

> Provider information endpoints

## Overview

Provider information endpoints

### Available Operations

* [List](#list) - List all providers
* [ListProviderEndpoints](#listproviderendpoints) - List a provider's endpoints with provider-wide stats

## List

List all providers

### Example Usage

```go theme={null}
package main

import(
	"context"
	"os"
	openrouter "github.com/OpenRouterTeam/go-sdk"
	"log"
)

func main() {
    ctx := context.Background()

    s := openrouter.New(
        openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")),
    )

    res, err := s.Providers.List(ctx)
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}
```

### Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | ✔️ | The context to use for the request. |
| `opts` | \[][operations.Option](../../models/operations/option.mdx) | ➖ | The options for this request. |

### Response

**[\*operations.ListProvidersResponse](../../models/operations/listprovidersresponse.mdx), error**

### Errors

| Error Type | Status Code | Content Type |
| - | - | - |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | \*/\* |

## ListProviderEndpoints

Returns every endpoint the provider serves, hidden ones included, with the provider-wide uptime, routing, latency and throughput stats over the window. Requires provider ownership, membership, or admin access.

### Example Usage

```go theme={null}
package main

import(
	"context"
	"os"
	openrouter "github.com/OpenRouterTeam/go-sdk"
	"github.com/OpenRouterTeam/go-sdk/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := openrouter.New(
        openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")),
    )

    res, err := s.Providers.ListProviderEndpoints(ctx, "fireworks", operations.ListProviderEndpointsWindowOned.ToPointer(), nil)
    if err != nil {
        log.Fatal(err)
    }
    if res != nil {
        // handle response
    }
}
```

### Parameters

| Parameter | Type | Required | Description | Example |
| - | - | - | - | - |
| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | ✔️ | The context to use for the request. | |
| `providerSlug` | `string` | ✔️ | URL-friendly provider identifier (e.g. "openai", "fireworks") | fireworks |
| `window` | [\*operations.ListProviderEndpointsWindow](../../models/operations/listproviderendpointswindow.mdx) | ➖ | Time window the provider-wide stats cover | 1d |
| `perfWorkload` | [\*operations.PerfWorkload](../../models/operations/perfworkload.mdx) | ➖ | Workload the latency and throughput stats measure; defaults to the workload most of the endpoints serve | text\_generation |
| `opts` | \[][operations.Option](../../models/operations/option.mdx) | ➖ | The options for this request. | |

### Response

**[\*components.ProviderEndpointsResponse](../../models/components/providerendpointsresponse.mdx), error**

### Errors

| Error Type | Status Code | Content Type |
| - | - | - |
| sdkerrors.BadRequestResponseError | 400 | application/json |
| sdkerrors.UnauthorizedResponseError | 401 | application/json |
| sdkerrors.ForbiddenResponseError | 403 | application/json |
| sdkerrors.NotFoundResponseError | 404 | application/json |
| sdkerrors.TooManyRequestsResponseError | 429 | application/json |
| sdkerrors.InternalServerResponseError | 500 | application/json |
| sdkerrors.APIError | 4XX, 5XX | \*/\* |
