Skip to main content
POST
/
assistants
cURL
curl "https://api.portkey.ai/v1/assistants" \
  -H "Content-Type: application/json" \
  -H "x-portkey-api-key: $PORTKEY_API_KEY" \
  -H "x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY" \
  -H "OpenAI-Beta: assistants=v2" \
  -d '{
    "instructions": "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
    "name": "Math Tutor",
    "tools": [{"type": "code_interpreter"}],
    "model": "gpt-4-turbo"
  }'
{
  "id": "<string>",
  "object": "assistant",
  "created_at": 123,
  "name": "<string>",
  "description": "<string>",
  "model": "<string>",
  "instructions": "<string>",
  "tools": [],
  "tool_resources": {
    "code_interpreter": {
      "file_ids": []
    },
    "file_search": {
      "vector_store_ids": [
        "<string>"
      ]
    }
  },
  "metadata": {},
  "temperature": 1,
  "top_p": 1,
  "response_format": "none"
}

Authorizations

x-portkey-api-key
string
header
required
x-portkey-virtual-key
string
header
required

Body

application/json
model
required
Example:
name
string | null
Maximum length: 256
description
string | null
Maximum length: 512
instructions
string | null
Maximum length: 256000
tools
(Code interpreter tool · object | FileSearch tool · object | Function tool · object)[]
Maximum length: 128
  • Code interpreter tool
  • FileSearch tool
  • Function tool
tool_resources
object | null
metadata
object | null
temperature
number | null
default:1
Required range: 0 <= x <= 2
Example:
top_p
number | null
default:1
Required range: 0 <= x <= 1
Example:
response_format
Available options:
none,
auto

Response

200 - application/json
id
string
required
object
enum<string>
required
Available options:
assistant
created_at
integer
required
name
string | null
required
Maximum length: 256
description
string | null
required
Maximum length: 512
model
string
required
instructions
string | null
required
Maximum length: 256000
tools
(Code interpreter tool · object | FileSearch tool · object | Function tool · object)[]
required
Maximum length: 128
  • Code interpreter tool
  • FileSearch tool
  • Function tool
metadata
object | null
required
tool_resources
object | null
temperature
number | null
default:1
Required range: 0 <= x <= 2
Example:
top_p
number | null
default:1
Required range: 0 <= x <= 1
Example:
response_format
Available options:
none,
auto