Skip to content

Create Skill

client.Skills.New(ctx, body) (*Skill, error)
POST/skills

Create Skill

ParametersExpand Collapse
body SkillNewParams
Files param.Field[SkillNewParamsFilesUnion]optional

Skill files to upload (directory upload) or a single zip file.

type SkillNewParamsFilesArray []Reader

Skill files to upload (directory upload) or a single zip file.

Reader
ReturnsExpand Collapse
type Skill struct{…}
ID string

Unique identifier for the skill.

CreatedAt int64

Unix timestamp (seconds) for when the skill was created.

DefaultVersion string

Default version for the skill.

Description string

Description of the skill.

LatestVersion string

Latest version for the skill.

Name string

Name of the skill.

Object Skill

The object type, which is skill.

Create Skill

package main

import (
  "context"
  "fmt"

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

func main() {
  client := openai.NewClient(
    option.WithAPIKey("My API Key"),
  )
  skill, err := client.Skills.New(context.TODO(), openai.SkillNewParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", skill.ID)
}
{
  "id": "id",
  "created_at": 0,
  "default_version": "default_version",
  "description": "description",
  "latest_version": "latest_version",
  "name": "name",
  "object": "skill"
}
Returns Examples
{
  "id": "id",
  "created_at": 0,
  "default_version": "default_version",
  "description": "description",
  "latest_version": "latest_version",
  "name": "name",
  "object": "skill"
}