Skip to content
Primary navigation

Create project

client.Admin.Organization.Projects.New(ctx, body) (*Project, error)
POST/organization/projects

Create a new project in the organization. Projects can be created and archived, but cannot be deleted.

ParametersExpand Collapse
body AdminOrganizationProjectNewParams
Name param.Field[string]

The friendly name of the project, this name appears in reports.

ExternalKeyID param.Field[string]Optional

External key ID to associate with the project.

Geography param.Field[string]Optional

Create the project with the specified data residency region. Your organization must have access to Data residency functionality in order to use. See data residency controls to review the functionality and limitations of setting this field.

ReturnsExpand Collapse
type Project struct{…}

Represents an individual project.

ID string

The identifier, which can be referenced in API endpoints

CreatedAt int64

The Unix timestamp (in seconds) of when the project was created.

formatunixtime
Object OrganizationProject

The object type, which is always organization.project

ArchivedAt int64Optional

The Unix timestamp (in seconds) of when the project was archived or null.

formatunixtime
ExternalKeyID stringOptional

The external key associated with the project.

Name stringOptional

The name of the project. This appears in reporting.

Status stringOptional

active or archived

Create project

package main

import (
  "context"
  "fmt"

  "github.com/openai/openai-go"
  "github.com/openai/openai-go/option"
)

func main() {
  client := openai.NewClient(
    option.WithAdminAPIKey("My Admin API Key"),
  )
  project, err := client.Admin.Organization.Projects.New(context.TODO(), openai.AdminOrganizationProjectNewParams{
    Name: "name",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", project.ID)
}
{
    "id": "proj_abc",
    "object": "organization.project",
    "name": "Project ABC",
    "created_at": 1711471533,
    "archived_at": null,
    "status": "active"
}
Returns Examples
{
    "id": "proj_abc",
    "object": "organization.project",
    "name": "Project ABC",
    "created_at": 1711471533,
    "archived_at": null,
    "status": "active"
}