{
  "openapi": "3.1.0",
  "info": {
    "title": "Triton AI Developer API",
    "version": "2026-09-04",
    "description": "Selected request and response fields from verified Triton AI examples. Model access and optional features depend on the route and API key."
  },
  "servers": [
    {
      "url": "https://tritonai-api.ucsd.edu"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Your Triton AI Developer API key."
      }
    }
  },
  "paths": {
    "/v1/models": {
      "get": {
        "summary": "List accessible models",
        "description": "List the models that your API key can use.",
        "operationId": "models",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Model alias."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request failed. See the Errors and retries guide for status-specific handling."
          }
        }
      }
    },
    "/v1/models/{model_id}": {
      "get": {
        "summary": "Retrieve a model",
        "description": "Retrieve one model that your API key can access.",
        "operationId": "model",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Model alias."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request failed. See the Errors and retries guide for status-specific handling."
          }
        },
        "parameters": [
          {
            "name": "model_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "A model alias that your API key can access.",
              "example": "gpt-5.4"
            }
          }
        ]
      }
    },
    "/v1/chat/completions": {
      "post": {
        "summary": "Create a chat completion",
        "description": "Send a text conversation. Optional fields and tool support depend on the model.",
        "operationId": "chat_completions",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "choices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "message": {
                            "type": "object",
                            "properties": {
                              "role": {
                                "type": "string",
                                "description": ""
                              },
                              "content": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            }
                          },
                          "finish_reason": {
                            "type": "string",
                            "description": ""
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request failed. See the Errors and retries guide for status-specific handling."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "A model alias that your API key can access.",
                    "example": "gpt-5.4"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string",
                          "description": "The message role.",
                          "enum": [
                            "system",
                            "user",
                            "assistant",
                            "tool"
                          ]
                        },
                        "content": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Text content for this example. Tool and image guides describe other content shapes."
                        }
                      },
                      "required": [
                        "role",
                        "content"
                      ]
                    }
                  },
                  "stream": {
                    "type": "boolean",
                    "default": false,
                    "description": "Return partial response events."
                  },
                  "max_completion_tokens": {
                    "type": "integer",
                    "description": "Maximum generated tokens for models that support this field."
                  },
                  "temperature": {
                    "type": "number",
                    "description": "Sampling value for models that support this field."
                  }
                },
                "required": [
                  "model",
                  "messages"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=os.environ[\"TRITONAI_API_KEY\"],\n    base_url=\"https://tritonai-api.ucsd.edu/v1\",\n)\n\ncompletion = client.chat.completions.create(\n    model=\"gpt-5.4\",\n    messages=[\n        {\n            \"role\": \"system\",\n            \"content\": \"Answer with short, direct sentences.\",\n        },\n        {\n            \"role\": \"user\",\n            \"content\": \"What is a model context window?\",\n        },\n    ],\n)\n\nprint(completion.choices[0].message.content)"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl https://tritonai-api.ucsd.edu/v1/chat/completions \\\n  --header \"Authorization: Bearer $TRITONAI_API_KEY\" \\\n  --header \"Content-Type: application/json\" \\\n  --data '{\n    \"model\": \"gpt-5.4\",\n    \"messages\": [\n      {\n        \"role\": \"system\",\n        \"content\": \"Answer with short, direct sentences.\"\n      },\n      {\n        \"role\": \"user\",\n        \"content\": \"What is a model context window?\"\n      }\n    ]\n  }'"
          }
        ]
      }
    },
    "/v1/responses": {
      "post": {
        "summary": "Create a response",
        "description": "Create a response with a compatible model. Test model compatibility before production use.",
        "operationId": "responses",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": ""
                    },
                    "output": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "description": ""
                          },
                          "content": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "description": ""
                                },
                                "text": {
                                  "type": "string",
                                  "description": ""
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request failed. See the Errors and retries guide for status-specific handling."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "A model alias that your API key can access.",
                    "example": "gpt-5.6-luna"
                  },
                  "input": {
                    "oneOf": [
                      {
                        "type": "string",
                        "description": ""
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      }
                    ],
                    "description": "Text or ordered input items."
                  },
                  "instructions": {
                    "type": "string",
                    "description": "Developer instruction."
                  },
                  "stream": {
                    "type": "boolean",
                    "default": false
                  },
                  "store": {
                    "type": "boolean",
                    "example": false,
                    "description": "Controls upstream response storage where supported."
                  }
                },
                "required": [
                  "model",
                  "input"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=os.environ[\"TRITONAI_API_KEY\"],\n    base_url=\"https://tritonai-api.ucsd.edu/v1\",\n)\n\nresponse = client.responses.create(\n    model=\"gpt-5.6-luna\",\n    input=\"Explain cosine similarity in two sentences.\",\n    store=False,\n)\n\nprint(response.output_text)"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl https://tritonai-api.ucsd.edu/v1/responses \\\n  --header \"Authorization: Bearer $TRITONAI_API_KEY\" \\\n  --header \"Content-Type: application/json\" \\\n  --data '{\n    \"model\": \"gpt-5.6-luna\",\n    \"input\": \"Explain cosine similarity in two sentences.\",\n    \"store\": false\n  }'"
          }
        ]
      }
    },
    "/v1/embeddings": {
      "post": {
        "summary": "Create embeddings",
        "description": "Create vectors from text. Use the same model and dimensions for documents and queries.",
        "operationId": "embeddings",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer"
                          },
                          "embedding": {
                            "type": "array",
                            "items": {
                              "type": "number",
                              "description": ""
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request failed. See the Errors and retries guide for status-specific handling."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "A model alias that your API key can access.",
                    "example": "api-tgpt-embeddings"
                  },
                  "input": {
                    "oneOf": [
                      {
                        "type": "string",
                        "description": ""
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "description": ""
                        }
                      }
                    ]
                  },
                  "dimensions": {
                    "type": "integer",
                    "enum": [
                      32,
                      64,
                      128,
                      256,
                      384,
                      512,
                      768,
                      1024,
                      2560
                    ],
                    "default": 1024,
                    "description": "Supported sizes for api-tgpt-embeddings."
                  }
                },
                "required": [
                  "model",
                  "input"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=os.environ[\"TRITONAI_API_KEY\"],\n    base_url=\"https://tritonai-api.ucsd.edu/v1\",\n)\n\nresponse = client.embeddings.create(\n    model=\"api-tgpt-embeddings\",\n    input=[\n        \"Information retrieval maps text to vectors.\",\n        \"Course catalogs contain titles and descriptions.\",\n    ],\n    dimensions=1024,\n)\n\nfor item in response.data:\n    print(item.index, len(item.embedding))"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl https://tritonai-api.ucsd.edu/v1/embeddings \\\n  --header \"Authorization: Bearer $TRITONAI_API_KEY\" \\\n  --header \"Content-Type: application/json\" \\\n  --data '{\n    \"model\": \"api-tgpt-embeddings\",\n    \"input\": [\n      \"Information retrieval maps text to vectors.\",\n      \"Course catalogs contain titles and descriptions.\"\n    ],\n    \"dimensions\": 1024\n  }'"
          }
        ]
      }
    },
    "/v1/audio/transcriptions": {
      "post": {
        "summary": "Transcribe audio",
        "description": "Upload an audio file as multipart form data. The tested example uses a non-empty mono PCM WAV at 16 kHz.",
        "operationId": "transcriptions",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string",
                      "description": "The transcript."
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "description": "Usage measurement type."
                        },
                        "seconds": {
                          "type": "number",
                          "description": "Audio usage in seconds."
                        }
                      }
                    }
                  },
                  "required": [
                    "text"
                  ]
                },
                "example": {
                  "text": "The library opens at nine in the morning.",
                  "usage": {
                    "type": "duration",
                    "seconds": 3.0
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request failed. See the Errors and retries guide for status-specific handling."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "A model alias that your API key can access.",
                    "example": "api-cohere-transcribe"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The audio recording."
                  }
                },
                "required": [
                  "model",
                  "file"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "python",
            "label": "Python",
            "source": "import os\n\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=os.environ[\"TRITONAI_API_KEY\"],\n    base_url=\"https://tritonai-api.ucsd.edu/v1\",\n)\n\nwith open(\"speech.wav\", \"rb\") as audio_file:\n    transcript = client.audio.transcriptions.create(\n        model=\"api-cohere-transcribe\",\n        file=audio_file,\n    )\n\nprint(transcript.text)"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl https://tritonai-api.ucsd.edu/v1/audio/transcriptions \\\n  --header \"Authorization: Bearer $TRITONAI_API_KEY\" \\\n  --form \"model=api-cohere-transcribe\" \\\n  --form \"file=@speech.wav\""
          }
        ]
      }
    },
    "/vllm/pooling": {
      "post": {
        "summary": "Classify private text",
        "description": "Run Privacy Filter as token classification. Returns token scores; redacted text requires a separate decoding step.",
        "operationId": "privacy_filter",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer"
                          },
                          "object": {
                            "type": "string",
                            "description": ""
                          },
                          "data": {
                            "type": "array",
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "number",
                                "description": "Classification score."
                              }
                            }
                          }
                        },
                        "required": [
                          "index",
                          "data"
                        ]
                      }
                    },
                    "usage": {
                      "type": "object",
                      "description": "Token usage."
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Request failed. See the Errors and retries guide for status-specific handling."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "A model alias that your API key can access.",
                    "example": "openai-privacy-filter"
                  },
                  "input": {
                    "type": "string",
                    "description": "Text to classify.",
                    "example": "Contact Jamie Example at jamie@example.com or 202-555-0142."
                  },
                  "task": {
                    "type": "string",
                    "description": "The pooling task.",
                    "enum": [
                      "token_classify"
                    ]
                  }
                },
                "required": [
                  "model",
                  "input",
                  "task"
                ]
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "python",
            "label": "Python",
            "source": "import json\nimport os\nfrom urllib.request import Request, urlopen\n\nrequest = Request(\n    \"https://tritonai-api.ucsd.edu/vllm/pooling\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['TRITONAI_API_KEY']}\",\n        \"Content-Type\": \"application/json\",\n    },\n    data=json.dumps({\n        \"model\": \"openai-privacy-filter\",\n        \"input\": \"Contact Jamie Example at jamie@example.com or 202-555-0142.\",\n        \"task\": \"token_classify\",\n    }).encode(\"utf-8\"),\n)\n\nwith urlopen(request, timeout=60) as response:\n    result = json.load(response)\n\nscores = result[\"data\"][0][\"data\"]\nprint(f\"Tokens: {len(scores)}\")\nprint(f\"Classes per token: {len(scores[0])}\")"
          },
          {
            "lang": "bash",
            "label": "cURL",
            "source": "curl --fail-with-body https://tritonai-api.ucsd.edu/vllm/pooling \\\n  --header \"Authorization: Bearer $TRITONAI_API_KEY\" \\\n  --header \"Content-Type: application/json\" \\\n  --data '{\n    \"model\": \"openai-privacy-filter\",\n    \"input\": \"Contact Jamie Example at jamie@example.com or 202-555-0142.\",\n    \"task\": \"token_classify\"\n  }'"
          }
        ]
      }
    },
    "/public/model_hub": {
      "get": {
        "summary": "Read the public catalog",
        "description": "Read public model metadata without an API key. Include only records whose is_public_model_group field is exactly true.",
        "operationId": "model_hub",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "model_group": {
                        "type": "string",
                        "description": ""
                      },
                      "is_public_model_group": {
                        "type": "boolean"
                      },
                      "is_self_hosted": {
                        "type": "boolean"
                      },
                      "mode": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "supported_openai_params": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "description": ""
                        }
                      },
                      "input_cost_per_token": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "output_cost_per_token": {
                        "type": [
                          "number",
                          "null"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Request failed. See the Errors and retries guide for status-specific handling."
          }
        },
        "security": []
      }
    }
  }
}
