Skip to content

Create Skill Version

client.Skills.Versions.New(ctx, skillID, body) (*SkillVersion, error)
POST/skills/{skill_id}/versions

Create Skill Version

ParametersExpand Collapse
skillID string
body SkillVersionNewParams
Default param.Field[bool]optional

Whether to set this version as the default.

Files param.Field[SkillVersionNewParamsFilesUnion]optional

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

type SkillVersionNewParamsFilesArray []Reader

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

Reader
ReturnsExpand Collapse
type SkillVersion struct{…}
ID string

Unique identifier for the skill version.

CreatedAt int64

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

Description string

Description of the skill version.

Name string

Name of the skill version.

Object SkillVersion

The object type, which is skill.version.

SkillID string

Identifier of the skill for this version.

Version string

Version number for this skill.

Create Skill Version

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"),
  )
  skillVersion, err := client.Skills.Versions.New(
    context.TODO(),
    "skill_123",
    openai.SkillVersionNewParams{

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