POST
/
assistants
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

Response

200 - application/json
OK

Represents an assistant that can call the model and use tools.