Skip to content

Commit eee9853

Browse files
authored
Revert recent change and clean up fields (#48)
* Revert "Fix breaking APIs (#45)" This reverts commit 2cc4322. * Revert "Version bump (#47)" This reverts commit 45157c6. * Revert api changes * Remove none existing fields * Further projects clean up * Remove usage limits * Fix rate limits * REmove unused field
1 parent 940d9d3 commit eee9853

24 files changed

+281
-938
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ REGISTRY_HOSTNAME=registry.terraform.io
77
NAMESPACE=mkdev-me
88
NAME=openai
99
BINARY=terraform-provider-${NAME}
10-
VERSION=1.2.0-rc.1
10+
VERSION=1.2.0
1111
OS_ARCH=darwin_arm64
1212

1313
default: install

docs/data-sources/organization_user.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ description: |-
2222

2323
### Read-Only
2424

25-
- `created` (Number) The Unix timestamp when the user was added to the organization
25+
- `added_at` (Number) The Unix timestamp when the user was added to the organization
2626
- `id` (String) The ID of this resource.
2727
- `name` (String) The name of the user
2828
- `role` (String) The role of the user in the organization (owner, member, or reader)

docs/data-sources/organization_users.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ output "all_users_count" {
4646

4747
Read-Only:
4848

49-
- `created` (Number)
49+
- `added_at` (Number)
5050
- `email` (String)
5151
- `id` (String)
5252
- `name` (String)

docs/data-sources/project.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ output "project_id" {
2828
# Use project data to set variables
2929
locals {
3030
project_active = data.openai_project.production.status == "active"
31-
project_title = data.openai_project.production.title
31+
project_name = data.openai_project.production.name
3232
}
3333
```
3434

@@ -45,9 +45,7 @@ locals {
4545

4646
### Read-Only
4747

48-
- `archived_at` (Number) Timestamp when the project was archived (null if not archived)
49-
- `created` (Number) Timestamp when the project was created
48+
- `created_at` (Number) Timestamp when the project was created
5049
- `id` (String) The ID of this resource.
51-
- `is_initial` (Boolean) Whether this is the initial project
50+
- `name` (String) The name of the project
5251
- `status` (String) The status of the project
53-
- `title` (String) The title of the project

docs/data-sources/projects.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ output "project_count" {
4242

4343
Read-Only:
4444

45-
- `archived_at` (Number)
46-
- `created` (Number)
45+
- `created_at` (Number)
4746
- `id` (String)
48-
- `is_initial` (Boolean)
47+
- `name` (String)
4948
- `status` (String)
50-
- `title` (String)

docs/resources/organization_user.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ resource "openai_organization_user" "organization_users" {
4141

4242
### Read-Only
4343

44-
- `created` (Number) The Unix timestamp when the user was added to the organization
44+
- `added_at` (Number) The Unix timestamp when the user was added to the organization
4545
- `email` (String) The email address of the user
4646
- `id` (String) The ID of this resource.
4747
- `name` (String) The name of the user

docs/resources/project.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ description: |-
1515
```terraform
1616
# Create a new OpenAI project
1717
resource "openai_project" "development" {
18-
title = "Development Project"
18+
name = "Development Project"
1919
}
2020
2121
# Create a production project
2222
resource "openai_project" "production" {
23-
title = "Production API Services"
23+
name = "Production API Services"
2424
}
2525
2626
# Output the project ID
@@ -35,18 +35,17 @@ output "dev_project_id" {
3535

3636
### Required
3737

38-
- `title` (String) The title of the project
38+
- `name` (String) The name of the project
3939

4040
### Optional
4141

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

4444
### Read-Only
4545

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

5251
<a id="nestedblock--timeouts"></a>

docs/resources/rate_limit.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,44 @@ description: |-
1010

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

13+
## Example Usage
1314

15+
```terraform
16+
# Set rate limits for GPT-4o model in a project
17+
resource "openai_rate_limit" "gpt4o_limits" {
18+
project_id = "proj_abc123"
19+
model = "gpt-4o"
20+
21+
max_requests_per_minute = 500
22+
max_tokens_per_minute = 30000
23+
}
24+
25+
# Set rate limits for GPT-4o-mini with additional constraints
26+
resource "openai_rate_limit" "gpt4o_mini_limits" {
27+
project_id = "proj_abc123"
28+
model = "gpt-4o-mini"
29+
30+
max_requests_per_minute = 1000
31+
max_tokens_per_minute = 60000
32+
max_requests_per_1_day = 10000
33+
}
34+
35+
# Set rate limits for DALL-E 3 image generation
36+
resource "openai_rate_limit" "dalle3_limits" {
37+
project_id = "proj_abc123"
38+
model = "dall-e-3"
39+
40+
max_images_per_minute = 5
41+
}
42+
43+
# Set rate limits for batch processing
44+
resource "openai_rate_limit" "batch_limits" {
45+
project_id = "proj_abc123"
46+
model = "gpt-4o"
47+
48+
batch_1_day_max_input_tokens = 1000000
49+
}
50+
```
1451

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

2562
- `batch_1_day_max_input_tokens` (Number) Maximum number of input tokens per day for batch processing.
26-
- `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.
2763
- `max_audio_megabytes_per_1_minute` (Number) Maximum audio megabytes per minute.
2864
- `max_images_per_minute` (Number) Maximum number of images per minute.
2965
- `max_requests_per_1_day` (Number) Maximum number of requests per day.

examples/data-sources/openai_project/data-source.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ output "project_id" {
1313
# Use project data to set variables
1414
locals {
1515
project_active = data.openai_project.production.status == "active"
16-
project_title = data.openai_project.production.title
16+
project_name = data.openai_project.production.name
1717
}

examples/resources/openai_project/resource.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Create a new OpenAI project
22
resource "openai_project" "development" {
3-
title = "Development Project"
3+
name = "Development Project"
44
}
55

66
# Create a production project
77
resource "openai_project" "production" {
8-
title = "Production API Services"
8+
name = "Production API Services"
99
}
1010

1111
# Output the project ID

0 commit comments

Comments
 (0)