Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ REGISTRY_HOSTNAME=registry.terraform.io
NAMESPACE=mkdev-me
NAME=openai
BINARY=terraform-provider-${NAME}
VERSION=1.2.0-rc.1
VERSION=1.2.0
OS_ARCH=darwin_arm64

default: install
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/organization_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ description: |-

### Read-Only

- `created` (Number) The Unix timestamp when the user was added to the organization
- `added_at` (Number) The Unix timestamp when the user was added to the organization
- `id` (String) The ID of this resource.
- `name` (String) The name of the user
- `role` (String) The role of the user in the organization (owner, member, or reader)
2 changes: 1 addition & 1 deletion docs/data-sources/organization_users.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ output "all_users_count" {

Read-Only:

- `created` (Number)
- `added_at` (Number)
- `email` (String)
- `id` (String)
- `name` (String)
Expand Down
8 changes: 3 additions & 5 deletions docs/data-sources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ output "project_id" {
# Use project data to set variables
locals {
project_active = data.openai_project.production.status == "active"
project_title = data.openai_project.production.title
project_name = data.openai_project.production.name
}
```

Expand All @@ -45,9 +45,7 @@ locals {

### Read-Only

- `archived_at` (Number) Timestamp when the project was archived (null if not archived)
- `created` (Number) Timestamp when the project was created
- `created_at` (Number) Timestamp when the project was created
- `id` (String) The ID of this resource.
- `is_initial` (Boolean) Whether this is the initial project
- `name` (String) The name of the project
- `status` (String) The status of the project
- `title` (String) The title of the project
6 changes: 2 additions & 4 deletions docs/data-sources/projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ output "project_count" {

Read-Only:

- `archived_at` (Number)
- `created` (Number)
- `created_at` (Number)
- `id` (String)
- `is_initial` (Boolean)
- `name` (String)
- `status` (String)
- `title` (String)
2 changes: 1 addition & 1 deletion docs/resources/organization_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ resource "openai_organization_user" "organization_users" {

### Read-Only

- `created` (Number) The Unix timestamp when the user was added to the organization
- `added_at` (Number) The Unix timestamp when the user was added to the organization
- `email` (String) The email address of the user
- `id` (String) The ID of this resource.
- `name` (String) The name of the user
Expand Down
11 changes: 5 additions & 6 deletions docs/resources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ description: |-
```terraform
# Create a new OpenAI project
resource "openai_project" "development" {
title = "Development Project"
name = "Development Project"
}

# Create a production project
resource "openai_project" "production" {
title = "Production API Services"
name = "Production API Services"
}

# Output the project ID
Expand All @@ -35,18 +35,17 @@ output "dev_project_id" {

### Required

- `title` (String) The title of the project
- `name` (String) The name of the project

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `archived_at` (Number) Timestamp when the project was archived, if applicable
- `created` (Number) Timestamp when the project was created
- `archived_at` (String) Timestamp when the project was archived, if applicable
- `created_at` (String) Timestamp when the project was created
- `id` (String) The ID of this resource.
- `is_initial` (Boolean) Whether this is the initial project
- `status` (String) Status of the project (active, archived, etc.)

<a id="nestedblock--timeouts"></a>
Expand Down
38 changes: 37 additions & 1 deletion docs/resources/rate_limit.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,44 @@ description: |-

Manages rate limits for an OpenAI model in a project. Note that rate limits cannot be truly deleted via the API, so this resource will reset rate limits to defaults when removed. This resource requires an admin API key with the api.management.read scope for full functionality, but will gracefully handle permission errors to allow operations to continue.

## Example Usage

```terraform
# Set rate limits for GPT-4o model in a project
resource "openai_rate_limit" "gpt4o_limits" {
project_id = "proj_abc123"
model = "gpt-4o"

max_requests_per_minute = 500
max_tokens_per_minute = 30000
}

# Set rate limits for GPT-4o-mini with additional constraints
resource "openai_rate_limit" "gpt4o_mini_limits" {
project_id = "proj_abc123"
model = "gpt-4o-mini"

max_requests_per_minute = 1000
max_tokens_per_minute = 60000
max_requests_per_1_day = 10000
}

# Set rate limits for DALL-E 3 image generation
resource "openai_rate_limit" "dalle3_limits" {
project_id = "proj_abc123"
model = "dall-e-3"

max_images_per_minute = 5
}

# Set rate limits for batch processing
resource "openai_rate_limit" "batch_limits" {
project_id = "proj_abc123"
model = "gpt-4o"

batch_1_day_max_input_tokens = 1000000
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -23,7 +60,6 @@ Manages rate limits for an OpenAI model in a project. Note that rate limits cann
### Optional

- `batch_1_day_max_input_tokens` (Number) Maximum number of input tokens per day for batch processing.
- `ignore_rate_limit_warning` (Boolean) Set to true to acknowledge that OpenAI rate limits cannot be truly deleted and will be reset to defaults on removal.
- `max_audio_megabytes_per_1_minute` (Number) Maximum audio megabytes per minute.
- `max_images_per_minute` (Number) Maximum number of images per minute.
- `max_requests_per_1_day` (Number) Maximum number of requests per day.
Expand Down
2 changes: 1 addition & 1 deletion examples/data-sources/openai_project/data-source.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ output "project_id" {
# Use project data to set variables
locals {
project_active = data.openai_project.production.status == "active"
project_title = data.openai_project.production.title
project_name = data.openai_project.production.name
}
4 changes: 2 additions & 2 deletions examples/resources/openai_project/resource.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Create a new OpenAI project
resource "openai_project" "development" {
title = "Development Project"
name = "Development Project"
}

# Create a production project
resource "openai_project" "production" {
title = "Production API Services"
name = "Production API Services"
}

# Output the project ID
Expand Down
34 changes: 34 additions & 0 deletions examples/resources/openai_rate_limit/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Set rate limits for GPT-4o model in a project
resource "openai_rate_limit" "gpt4o_limits" {
project_id = "proj_abc123"
model = "gpt-4o"

max_requests_per_minute = 500
max_tokens_per_minute = 30000
}

# Set rate limits for GPT-4o-mini with additional constraints
resource "openai_rate_limit" "gpt4o_mini_limits" {
project_id = "proj_abc123"
model = "gpt-4o-mini"

max_requests_per_minute = 1000
max_tokens_per_minute = 60000
max_requests_per_1_day = 10000
}

# Set rate limits for DALL-E 3 image generation
resource "openai_rate_limit" "dalle3_limits" {
project_id = "proj_abc123"
model = "dall-e-3"

max_images_per_minute = 5
}

# Set rate limits for batch processing
resource "openai_rate_limit" "batch_limits" {
project_id = "proj_abc123"
model = "gpt-4o"

batch_1_day_max_input_tokens = 1000000
}
Loading