# openai Package

This page lists the exported API of `core/openai`, the embedding client used for ToriiDB vector operations.

## Client

```go
type Client struct {
    APIKey string
    Dim    int
    Model  string
}

func New(apiKey string) (*Client, error)
func (c *Client) Embed(ctx context.Context, text string) ([]float32, error)
```

`Embed` rejects blank text, returns `<status>: <body>` for non-200 responses, and fails when the vector length differs from `Dim`.

## Related Pages

- [API Key](/configuration-api-key)
- [Attaching Vectors](/vector-search)
- [Embedding Cache](/vector-search-cache)
