Skip to content

Commit 25638c6

Browse files
committed
ref: update provider docs
1 parent 97dcb09 commit 25638c6

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

docs/index.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@
33
page_title: "openai Provider"
44
subcategory: ""
55
description: |-
6-
6+
The OpenAI provider allows you to configure resources and data sources for your OpenAI organization. It uses internal APIs, so breaking changes are expected.
7+
Unfortunately, OpenAI's API keys do not allow some functionalities. Therefore, we need to obtain an OpenAI session key from the Authorization header of any requests to https://api.openai.com/dashboard/*. Log in to https://platform.openai.com, use Inspect Element to look for any requests to https://api.openai.com/dashboard/*, and grab the Authorization header value.
78
---
89

910
# openai Provider
1011

12+
The OpenAI provider allows you to configure resources and data sources for your OpenAI organization. It uses internal APIs, so breaking changes are expected.
1113

14+
Unfortunately, OpenAI's API keys do not allow some functionalities. Therefore, we need to obtain an OpenAI session key from the `Authorization` header of any requests to `https://api.openai.com/dashboard/*`. Log in to https://platform.openai.com, use Inspect Element to look for any requests to `https://api.openai.com/dashboard/*`, and grab the `Authorization` header value.
1215

1316
## Example Usage
1417

1518
```terraform
1619
provider "openai" {
17-
# example configuration here
20+
session_key = "sess-0000000000000000000000000000000000000000"
1821
}
1922
```
2023

@@ -24,4 +27,4 @@ provider "openai" {
2427
### Optional
2528

2629
- `base_url` (String) Base URL for the OpenAI API. Defaults to `https://api.openai.com`.
27-
- `session_key` (String, Sensitive) Session key for the OpenAI API.
30+
- `session_key` (String, Sensitive) The OpenAI session key can be obtained by accessing the dashboard in your browser. This can also be set via the `OPENAI_SESSION_KEY` environment variable. Note that the session key must start with `sess-`.

examples/provider/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
provider "openai" {
2-
# example configuration here
2+
session_key = "sess-0000000000000000000000000000000000000000"
33
}

internal/provider/provider.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@ func (p *OpenAIProvider) Metadata(ctx context.Context, req provider.MetadataRequ
4040

4141
func (p *OpenAIProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse) {
4242
resp.Schema = schema.Schema{
43+
MarkdownDescription: "The OpenAI provider allows you to configure resources and data sources for your OpenAI organization. It uses internal APIs, so breaking changes are expected.\n\n" +
44+
"Unfortunately, OpenAI's API keys do not allow some functionalities. Therefore, we need to obtain an OpenAI session key from the `Authorization` header of any requests to `https://api.openai.com/dashboard/*`. Log in to https://platform.openai.com, use Inspect Element to look for any requests to `https://api.openai.com/dashboard/*`, and grab the `Authorization` header value.",
4345
Attributes: map[string]schema.Attribute{
4446
"base_url": schema.StringAttribute{
4547
MarkdownDescription: "Base URL for the OpenAI API. Defaults to `https://api.openai.com`.",
4648
Optional: true,
4749
},
4850
"session_key": schema.StringAttribute{
49-
MarkdownDescription: "Session key for the OpenAI API.",
51+
MarkdownDescription: "The OpenAI session key can be obtained by accessing the dashboard in your browser. This can also be set via the `OPENAI_SESSION_KEY` environment variable. Note that the session key must start with `sess-`.",
5052
Optional: true,
5153
Sensitive: true,
5254
},

0 commit comments

Comments
 (0)