Portkey Logs Export API

Exports logs service.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/portkey-logs-export-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

portkey-logs-export-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Portkey Analytics > Graphs Logs Export API
  description: The Portkey REST API. Please see https://portkey.ai/docs/api-reference for more details.
  version: 2.0.0
  termsOfService: https://portkey.ai/terms
  contact:
    name: Portkey Developer Forum
    url: https://portkey.wiki/community
  license:
    name: MIT
    url: https://github.com/Portkey-AI/portkey-openapi/blob/master/LICENSE
servers:
- url: https://api.portkey.ai/v1
  description: Portkey API Public Endpoint
security:
- Portkey-Key: []
tags:
- name: Logs Export
  description: Exports logs service.
paths:
  /logs/exports/{exportId}:
    servers:
    - url: https://api.portkey.ai/v1
      description: Portkey API Public Endpoint
    - url: SELF_HOSTED_CONTROL_PLANE_URL
      description: Self-Hosted Control Plane URL
    get:
      tags:
      - Logs Export
      summary: Get a specific logs export
      parameters:
      - name: exportId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportItem'
      x-code-samples:
      - lang: python
        label: Default
        source: "from portkey_ai import Portkey\n\nportkey = Portkey(\n  api_key=\"PORTKEY_API_KEY\"\n)\n\nres = portkey.logs.exports.retrieve(\n  export_id=\"EXPORT_ID\"\n)\n\nprint(res)\n"
      - lang: javascript
        label: Default
        source: "import Portkey from \"portkey-ai\";\n\nconst portkey = new Portkey({\n  apiKey:\"PORTKEY_API_KEY\"\n})\n\nasync function main() {\n  const res= await portkey.logs.exports.retrieve({\n    exportId:\"EXPORT_ID\"\n  });\n\n  console.log(res);\n}\n\nmain();\n"
      - lang: curl
        label: Default
        source: 'curl -X GET "https://api.portkey.ai/v1/logs/exports/EXPORT_ID" \

          -H "x-portkey-api-key: PORTKEY_API_KEY"

          '
      - lang: curl
        label: Self-Hosted
        source: 'curl -X GET "SELF_HOSTED_CONTROL_PLANE_URL/logs/exports/EXPORT_ID" \

          -H "x-portkey-api-key: PORTKEY_API_KEY"

          '
      - lang: python
        label: Self-Hosted
        source: "from portkey_ai import Portkey\n\nportkey = Portkey(\n  api_key=\"PORTKEY_API_KEY\",\n  base_url=\"SELF_HOSTED_CONTROL_PLANE_URL\"\n)\n\nres = portkey.logs.exports.retrieve(\n  export_id='EXPORT_ID'\n)\n\nprint(res)\n"
      - lang: javascript
        label: Self-Hosted
        source: "import Portkey from \"portkey-ai\";\n\nconst portkey = new Portkey({\n  apiKey:\"PORTKEY_API_KEY\",\n  baseUrl:\"SELF_HOSTED_CONTROL_PLANE_URL\"\n})\n\nasync function main() {\n  const res= await portkey.logs.exports.retrieve({\n    exportId:'EXPORT_ID'\n  });;\n\n  console.log(res);\n}\n\nmain()\n"
    put:
      tags:
      - Logs Export
      summary: Update a logs export
      parameters:
      - name: exportId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_id:
                  type: string
                filters:
                  $ref: '#/components/schemas/GenerationsFilterSchema'
                requested_data:
                  $ref: '#/components/schemas/LogExportsRequestedData'
              required:
              - filters
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateExportResponse'
      x-code-samples:
      - lang: python
        label: Default
        source: "from portkey_ai import Portkey\n\nportkey = Portkey(\n  api_key=\"PORTKEY_API_KEY\"\n)\n\nres = portkey.logs.exports.update(\n  export_id=\"EXPORT_ID\",\n  workspace_id=\"WORKSPACE_ID\",\n  filters={\n    \"time_of_generation_max\": \"2024-07-25\"\n  }\n)\n\nprint(res)\n"
      - lang: javascript
        label: Default
        source: "import Portkey from \"portkey-ai\";\n\nconst portkey = new Portkey({\n  apiKey:\"PORTKEY_API_KEY\"\n})\n\nasync function main() {\n  const res = await portkey.logs.exports.update({\n    exportId:\"7ef9f738-a93a-xxx-xxx-xxxxx\",\n    workspaceId: \"ws-shared-xxx\",\n    filters: {\n      \"time_of_generation_max\": \"2024-07-25\"\n    }\n  });\n\n  console.log(res);\n}\n\nmain();\n"
      - lang: curl
        label: Default
        source: 'curl -X PUT "https://api.portkey.ai/v1/logs/exports/EXPORT_ID" \

          -H "x-portkey-api-key: PORTKEY_API_KEY" \

          -H "Content-Type: application/json" \

          -d ''{"workspace_id":"WORKSPACE_ID","filters":{"time_of_generation_max":"2024-07-25"}}''

          '
      - lang: curl
        label: Self-Hosted
        source: 'curl -X PUT "SELF_HOSTED_CONTROL_PLANE_URL/logs/exports/EXPORT_ID" \

          -H "x-portkey-api-key: PORTKEY_API_KEY" \

          -H "Content-Type: application/json" \

          -d ''{"workspace_id":"WORKSPACE_ID","filters":{"time_of_generation_max":"2024-07-25"}}''

          '
      - lang: python
        label: Self-Hosted
        source: "from portkey_ai import Portkey\n\nportkey = Portkey(\n  api_key=\"PORTKEY_API_KEY\",\n  base_url=\"SELF_HOSTED_CONTROL_PLANE_URL\"\n)\n\nres = portkey.logs.exports.update(\n  export_id='EXPORT_ID',\n  workspace_id='WORKSPACE_ID',\n  filters={\n    'time_of_generation_max': '2024-07-25'\n  }\n)\n\nprint(res)\n"
      - lang: javascript
        label: Self-Hosted
        source: "import Portkey from \"portkey-ai\";\n\nconst portkey = new Portkey({\n  apiKey:\"PORTKEY_API_KEY\",\n  baseUrl:\"SELF_HOSTED_CONTROL_PLANE_URL\"\n})\n\nasync function main() {\n  const res = await portkey.logs.exports.update({\n    exportId:\"7ef9f738-a93a-xxx-xxx-xxxxx\",\n    workspaceId: \"ws-shared-xxx\",\n    filters: {\n      \"time_of_generation_max\": \"2024-07-25\"\n    }\n  });\n\n  console.log(res);\n}\n\nmain();\n"
  /logs/exports:
    servers:
    - url: https://api.portkey.ai/v1
      description: Portkey API Public Endpoint
    - url: SELF_HOSTED_CONTROL_PLANE_URL
      description: Self-Hosted Control Plane URL
    get:
      tags:
      - Logs Export
      summary: Get all logs exports
      parameters:
      - name: workspace_id
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportListResponse'
      x-code-samples:
      - lang: python
        label: Default
        source: "from portkey_ai import Portkey\n\nportkey = Portkey(\n  api_key=\"PORTKEY_API_KEY\"\n)\n\nres = portkey.logs.exports.list(\n  workspace_id=\"WORKSPACE_ID\"\n)\n\nprint(res)\n"
      - lang: javascript
        label: Default
        source: "import Portkey from \"portkey-ai\";\n\nasync function main() {\n  const portkey = new Portkey({\n    apiKey:\"PORTKEY_API_KEY\"\n  })\n\n  const res = await portkey.logs.exports.list({\n    workspaceId:\"WORKSPACE_ID\"\n  });\n\n  console.log(res);\n}\n\nmain();\n"
      - lang: curl
        label: Default
        source: 'curl -X GET "https://api.portkey.ai/v1/logs/exports?workspace_id=WORKSPACE_ID" \

          -H "x-portkey-api-key: PORTKEY_API_KEY"

          '
      - lang: curl
        label: Self-Hosted
        source: 'curl -X GET "SELF_HOSTED_CONTROL_PLANE_URL/logs/exports?workspace_id=WORKSPACE_ID" \

          -H "x-portkey-api-key: PORTKEY_API_KEY"

          '
      - lang: python
        label: Self-Hosted
        source: "from portkey_ai import Portkey\n\nportkey = Portkey(\n  api_key=\"PORTKEY_API_KEY\",\n  base_url=\"SELF_HOSTED_CONTROL_PLANE_URL\"\n)\n\nres = portkey.logs.exports.list(\n  workspace_id=\"WORKSPACE_ID\"\n)\n\nprint(res)\n"
      - lang: javascript
        label: Self-Hosted
        source: "import Portkey from \"portkey-ai\";\n\nasync function main() {\n  const portkey = new Portkey({\n    apiKey:\"PORTKEY_API_KEY\",\n    baseUrl:\"SELF_HOSTED_CONTROL_PLANE_URL\"\n  })\n\n  const res = await portkey.logs.exports.list({\n    workspaceId:\"WORKSPACE_ID\"\n  });\n\n  console.log(res);\n}\n\nmain();\n"
    post:
      tags:
      - Logs Export
      summary: Create log export
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_id:
                  type: string
                filters:
                  $ref: '#/components/schemas/GenerationsFilterSchema'
                requested_data:
                  $ref: '#/components/schemas/LogExportsRequestedData'
              required:
              - filters
              - requested_data
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateExportResponse'
      x-code-samples:
      - lang: python
        label: Default
        source: "from portkey_ai import Portkey\n\nportkey = Portkey(\n   api_key=\"PORTKEY_API_KEY\"\n)\n\nres = portkey.logs.exports.create(\n  filters={\n    'time_of_generation_min': \"2024-10-20\",\n    'time_of_generation_max': \"2024-10-30\"\n  },\n  workspace_id=\"WORKSPACE_ID\",\n  description=\"This is random description\",\n  requested_data=[\n    \"id\",\n    \"trace_id\",\n    \"created_at\",\n    \"request\",\n    \"response\",\n    \"is_success\",\n    \"ai_org\",\n    \"ai_model\",\n    \"req_units\",\n    \"res_units\",\n    \"total_units\",\n    \"request_url\",\n    \"cost\",\n    \"cost_currency\",\n    \"response_time\",\n    \"response_status_code\",\n    \"mode\",\n    \"config\",\n    \"prompt_slug\",\n    \"metadata\"\n  ]\n)\n\nprint(res)\n"
      - lang: javascript
        label: Default
        source: "import Portkey from \"portkey-ai\";\n\nconst portkey = new Portkey({\n  apiKey:\"PORTKEY_API_KEY\"\n})\n\nasync function main() {\n  const res = await portkey.logs.exports.create({\n      filters: {\n        time_of_generation_min: \"2024-10-20\",\n        time_of_generation_max: \"2024-10-30\"\n      },\n      \"workspaceId\": \"WORKSPACE_ID\",\",\n      \"description\": \"This is random description\",\n      \"requestedData\": [\n        \"id\",\n        \"trace_id\",\n        \"created_at\",\n        \"request\",\n        \"response\",\n        \"is_success\",\n        \"ai_org\",\n        \"ai_model\",\n        \"req_units\",\n        \"res_units\",\n        \"total_units\",\n        \"request_url\",\n        \"cost\",\n        \"cost_currency\",\n        \"response_time\",\n        \"response_status_code\",\n        \"mode\",\n        \"config\",\n        \"prompt_slug\",\n        \"metadata\"\n      ]\n  });\n\n  console.log(res);\n}\n\nmain();\n"
      - lang: curl
        label: Default
        source: "curl -X POST \"https://api.portkey.ai/v1/logs/exports\" \\\n-H \"x-portkey-api-key: PORTKEY_API_KEY\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n  \"workspace_id\": \"WORKSPACE_ID\",\n  \"filters\": {\n    \"time_of_generation_min\": \"2024-10-20\",\n    \"time_of_generation_max\": \"2024-10-30\"\n  },\n  \"description\": \"This is random description\",\n  \"requested_data\": [\n    \"id\",\n    \"trace_id\",\n    \"created_at\",\n    \"request\",\n    \"response\",\n    \"is_success\",\n    \"ai_org\",\n    \"ai_model\",\n    \"req_units\",\n    \"res_units\",\n    \"total_units\",\n    \"request_url\",\n    \"cost\",\n    \"cost_currency\",\n    \"response_time\",\n    \"response_status_code\",\n    \"mode\",\n    \"config\",\n    \"prompt_slug\",\n    \"metadata\"\n  ]\n}'\n"
      - lang: python
        label: Self-Hosted
        source: "from portkey_ai import Portkey\n\nportkey = Portkey(\n   api_key=\"PORTKEY_API_KEY\",\n   base_url=\"SELF_HOSTED_CONTROL_PLANE_URL\"\n)\n\nres = portkey.logs.exports.create(\n  filters={\n    'time_of_generation_min': \"2024-10-20\",\n    'time_of_generation_max': \"2024-10-30\"\n  },\n  workspace_id=\"WORKSPACE_ID\",\n  description=\"This is random description\",\n  requested_data=[\n    \"id\",\n    \"trace_id\",\n    \"created_at\",\n    \"request\",\n    \"response\",\n    \"is_success\",\n    \"ai_org\",\n    \"ai_model\",\n    \"req_units\",\n    \"res_units\",\n    \"total_units\",\n    \"request_url\",\n    \"cost\",\n    \"cost_currency\",\n    \"response_time\",\n    \"response_status_code\",\n    \"mode\",\n    \"config\",\n    \"prompt_slug\",\n    \"metadata\"\n  ]\n)\n\nprint(res)\n"
      - lang: javascript
        label: Self-Hosted
        source: "import Portkey from \"portkey-ai\";\n\nconst portkey = new Portkey({\n  apiKey:\"PORTKEY_API_KEY\",\n  baseUrl:\"SELF_HOSTED_CONTROL_PLANE_URL\"\n})\n\nasync function main() {\n  const res = await portkey.logs.exports.create({\n      filters: {\n        time_of_generation_min: \"2024-10-20\",\n        time_of_generation_max: \"2024-10-30\"\n      },\n      \"workspaceId\": \"WORKSPACE_ID\",\",\n      \"description\": \"This is random description\",\n      \"requestedData\": [\n        \"id\",\n        \"trace_id\",\n        \"created_at\",\n        \"request\",\n        \"response\",\n        \"is_success\",\n        \"ai_org\",\n        \"ai_model\",\n        \"req_units\",\n        \"res_units\",\n        \"total_units\",\n        \"request_url\",\n        \"cost\",\n        \"cost_currency\",\n        \"response_time\",\n        \"response_status_code\",\n        \"mode\",\n        \"config\",\n        \"prompt_slug\",\n        \"metadata\"\n      ]\n  });\n\n  console.log(res);\n}\n\nmain();\n"
  /logs/exports/{exportId}/start:
    servers:
    - url: https://api.portkey.ai/v1
      description: Portkey API Public Endpoint
    - url: SELF_HOSTED_CONTROL_PLANE_URL
      description: Self-Hosted Control Plane URL
    post:
      tags:
      - Logs Export
      summary: Start log export
      parameters:
      - name: exportId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportTaskResponse'
      x-code-samples:
      - lang: python
        label: Default
        source: "from portkey_ai import Portkey\n\nportkey = Portkey(\n  api_key=\"PORTKEY_API_KEY\"\n)\n\nres = portkey.logs.exports.start(\n  export_id='EXPORT_ID'\n)\n\nprint(res)\n"
      - lang: javascript
        label: Default
        source: "import Portkey from \"portkey-ai\";\n\nconst portkey = new Portkey({\n  apiKey:\"PORTKEY_API_KEY\"\n})\n\nasync function main() {\n  const res = await portkey.logs.exports.start({\n    exportId:'EXPORT_ID'\n  });\n\n  console.log(res);\n}\n\nmain();\n"
      - lang: curl
        label: Default
        source: "curl -X POST https://api.portkey.ai/v1/logs/exports/EXPORT_ID/start\n  -H \"x-portkey-api-key: PORTKEY_API_KEY\"\n  -H \"Content-Type: application/json\"\n"
      - lang: python
        label: Self-Hosted
        source: "from portkey_ai import Portkey\n\nportkey = Portkey(\n  api_key=\"PORTKEY_API_KEY\",\n  base_url=\"SELF_HOSTED_CONTROL_PLANE_URL\"\n)\n\nres = portkey.logs.exports.start(\n  export_id='EXPORT_ID'\n)\n\nprint(res)\n"
      - lang: javascript
        label: Self-Hosted
        source: "import Portkey from \"portkey-ai\";\n\nconst portkey = new Portkey({\n  apiKey:\"PORTKEY_API_KEY\",\n  baseUrl:\"SELF_HOSTED_CONTROL_PLANE_URL\"\n})\n\nasync function main() {\n  const res = await portkey.logs.exports.start({\n    exportId:'EXPORT_ID'\n  });\n\n  console.log(res);\n}\n\nmain();\n"
  /logs/exports/{exportId}/cancel:
    servers:
    - url: https://api.portkey.ai/v1
      description: Portkey API Public Endpoint
    - url: SELF_HOSTED_CONTROL_PLANE_URL
      description: Self-Hosted Control Plane URL
    post:
      tags:
      - Logs Export
      summary: Cancel log export
      parameters:
      - name: exportId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportTaskResponse'
      x-code-samples:
      - lang: python
        label: Default
        source: "from portkey_ai import Portkey\n\nportkey = Portkey(\n  api_key=\"PORTKEY_API_KEY\"\n)\n\nres = portkey.logs.exports.cancel(\n  export_id='EXPORT_ID'\n)\n\nprint(res)\n"
      - lang: javascript
        label: Default
        source: "import Portkey from \"portkey-ai\";\n\nconst portkey = new Portkey({\n  apiKey:\"PORTKEY_API_KEY\",\n})\n\nasync function main() {\n  const res = await portkey.logs.exports.cancel({\n    exportId:'EXPORT_ID'\n  });\n\n  console.log(res);\n}\n\nmain();\n"
      - lang: curl
        label: Default
        source: "curl -X POST https://api.portkey.ai/v1/logs/exports/EXPORT_ID/cancel\n  -H \"x-portkey-api-key: PORTKEY_API_KEY\"\n  -H \"Content-Type: application/json\"\n"
      - lang: python
        label: Self-Hosted
        source: "from portkey_ai import Portkey\n\nportkey = Portkey(\n  api_key=\"PORTKEY_API_KEY\",\n  base_url=\"SELF_HOSTED_CONTROL_PLANE_URL\"\n)\n\nres = portkey.logs.exports.cancel(\n  export_id='EXPORT_ID'\n)\n\nprint(res)\n"
      - lang: javascript
        label: Self-Hosted
        source: "import Portkey from \"portkey-ai\";\n\nconst portkey = new Portkey({\n  apiKey:\"PORTKEY_API_KEY\",\n  baseUrl:\"SELF_HOSTED_CONTROL_PLANE_URL\"\n})\n\nasync function main() {\n  const res = await portkey.logs.exports.cancel({\n    exportId:'EXPORT_ID'\n  });\n\n  console.log(res);\n}\n\nmain();\n"
  /logs/exports/{exportId}/download:
    servers:
    - url: https://api.portkey.ai/v1
      description: Portkey API Public Endpoint
    - url: SELF_HOSTED_CONTROL_PLANE_URL
      description: Self-Hosted Control Plane URL
    get:
      tags:
      - Logs Export
      summary: Download log export
      parameters:
      - name: exportId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DownloadLogsResponse'
      x-code-samples:
      - lang: python
        label: Default
        source: "from portkey_ai import Portkey\n\nportkey = Portkey(\n  api_key=\"PORTKEY_API_KEY\"\n)\n\nres = portkey.logs.exports.download(\n  export_id='EXPORT_ID'\n)\n\nprint(res)\n"
      - lang: javascript
        label: Default
        source: "import Portkey from \"portkey-ai\";\n\nconst portkey = new Portkey({\n  apiKey:\"PORTKEY_API_KEY\"\n})\n\nasync function main() {\n  const config=await portkey.logs.exports.download({\n    exportId:'EXPORT_ID'\n  });;\n\n  console.log(config);\n}\n\nmain()\n"
      - lang: curl
        label: Default
        source: "curl -X GET https://api.portkey.ai/v1/logs/exports/EXPORT_ID/download\n  -H \"x-portkey-api-key: PORTKEY_API_KEY\"\n  -H \"Content-Type: application/json\"\n"
      - lang: python
        label: Self-Hosted
        source: "from portkey_ai import Portkey\n\nportkey = Portkey(\n  api_key=\"PORTKEY_API_KEY\",\n  base_url=\"SELF_HOSTED_CONTROL_PLANE_URL\"\n)\n\nres = portkey.logs.exports.download(\n  export_id='EXPORT_ID'\n)\n\nprint(res)\n"
      - lang: javascript
        label: Self-Hosted
        source: "import Portkey from \"portkey-ai\";\n\nconst portkey = new Portkey({\n  apiKey:\"PORTKEY_API_KEY\",\n  baseUrl:\"SELF_HOSTED_CONTROL_PLANE_URL\"\n})\n\nasync function main() {\n  const config=await portkey.logs.exports.download({\n    exportId:'EXPORT_ID'\n  });;\n\n  console.log(config);\n}\n\nmain()\n"
components:
  schemas:
    ExportTaskResponse:
      type: object
      properties:
        message:
          type: string
          description: A message indicating the status of the export task
        object:
          type: string
          enum:
          - export
          description: The type of the object
      required:
      - message
      - object
    GenerationsFilterSchema:
      type: object
      properties:
        time_of_generation_min:
          type: string
          format: date-time
        time_of_generation_max:
          type: string
          format: date-time
        total_units_min:
          type: integer
        total_units_max:
          type: integer
        cost_min:
          type: number
        cost_max:
          type: number
        ai_model:
          type: string
        prompt_token_min:
          type: integer
        prompt_token_max:
          type: integer
        completion_token_min:
          type: integer
        completion_token_max:
          type: integer
        status_code:
          type: string
        metadata:
          type: object
          additionalProperties: true
        ai_org_model:
          type: string
          example: openai__gpt-3.5-turbo, anthropic__claude-2.1
        weighted_feedback_min:
          type: number
        weighted_feedback_max:
          type: number
        virtual_keys:
          type: string
        trace_id:
          type: string
        configs:
          type: string
        workspace_slug:
          type: string
        prompt_slug:
          type: string
        page_size:
          type: number
          description: 'max: 50000, default: 50000'
          example: 50000
        current_page:
          type: number
          example: 0
    ExportListResponse:
      type: object
      properties:
        object:
          type: string
          enum:
          - list
        total:
          type: integer
        data:
          type: array
          items:
            $ref: '#/components/schemas/ExportItem'
    LogExportsRequestedData:
      type: array
      items:
        type: string
        enum:
        - id
        - trace_id
        - created_at
        - request
        - response
        - is_success
        - ai_org
        - ai_model
        - req_units
        - res_units
        - total_units
        - request_url
        - cost
        - cost_currency
        - response_time
        - response_status_code
        - mode
        - config
        - prompt_slug
        - metadata
    DownloadLogsResponse:
      type: object
      properties:
        signed_url:
          type: string
          format: uri
          description: A pre-signed URL for downloading the exported logs
      required:
      - signed_url
    UpdateExportResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier of the updated export
        total:
          type: integer
          description: The total number of items in the export
        object:
          type: string
          enum:
          - export
          description: The type of the object
      required:
      - id
      - total
      - object
    ExportItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
        organisation_id:
          type: string
          format: uuid
        filters:
          $ref: '#/components/schemas/GenerationsFilterSchema'
        requested_data:
          $ref: '#/components/schemas/LogExportsRequestedData'
        status:
          type: string
          enum:
          - draft
          - in_progress
          - success
          - failed
          - stopped
        description:
          type: string
        created_at:
          type: string
          format: date-time
        last_updated_at:
          type: string
          format: date-time
        created_by:
          type: string
          format: uuid
        workspace_id:
          type: string
          format: uuid
        object:
          type: string
          enum:
          - export
      required:
      - id
      - organisation_id
      - filters
      - requested_data
      - status
      - description
      - created_at
      - last_updated_at
      - created_by
      - workspace_id
      - object
  securitySchemes:
    Portkey-Key:
      type: apiKey
      in: header
      name: x-portkey-api-key
    Virtual-Key:
      type: apiKey
      in: header
      name: x-portkey-virtual-key
    Provider-Auth:
      type: http
      scheme: bearer
    Provider-Name:
      type: apiKey
      in: header
      name: x-portkey-provider
    Config:
      type: apiKey
      in: header
      name: x-portkey-config
    Custom-Host:
      type: apiKey
      in: header
      name: x-portkey-custom-host
x-server-groups:
  ControlPlaneServers:
  - url: https://api.portkey.ai/v1
    description: Portkey API Public Endpoint
  - url: SELF_HOSTED_CONTROL_PLANE_URL
    description: Self-Hosted Control Plane URL
  DataPlaneServers:
  - url: https://api.portkey.ai/v1
    description: Portkey API Public Endpoint
  - url: SELF_HOSTED_GATEWAY_URL
    description: Self-Hosted Gateway URL
  PublicServers:
  - url: https://api.portkey.ai
    description: Portkey Public API (no auth required)
x-mint:
  mcp:
    enabled: true
    name: Portkey MCP
    description: Official MCP Server for Portkey Docs & APIs
x-code-samples:
  navigationGroups:
  - id: endpoints
    title: Endpoints
  - id: assistants
    title: Assistants
  - id: legacy
    title: Legacy
  groups:
  - id: audio
    title: Audio
    description: 'Learn how to turn audio into text or text into audio.


      Related guide: [Speech to text](https://platform.openai.com/docs/guides/speech-to-text)

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createSpeech
      path: createSpeech
    - type: endpoint
      key: createTranscription
      path: createTranscription
    - type: endpoint
      key: createTranslation
      path: createTranslation
    - type: object
      key: CreateTranscriptionResponseJson
      path: json-object
    - type: object
      key: CreateTranscriptionResponseVerboseJson
      path: verbose-json-object
  - id: chat
    title: Chat
    description: 'Given a list of messages comprising a conversation, the model will return a response.


      Related guide: [Chat Completions](https://platform.openai.com/docs/guides/text-generation)

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createChatCompletion
      path: create
    - type: object
      key: CreateChatCompletionResponse
      path: object
    - type: object
      key: CreateChatCompletionStreamResponse
      path: streaming
  - id: realtime
    title: Realtime
    description: 'WebSocket proxy for provider Realtime APIs (`GET` upgrade). Use `wss://` with the same `/v1` data-plane base as other gateway routes.


      Related guide: [OpenAI Realtime API](https://platform.openai.com/docs/guides/realtime)

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: connectRealtime
      path: connect
  - id: embeddings
    title: Embeddings
    description: 'Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.


      Related guide: [Embeddings](https://platform.openai.com/docs/guides/embeddings)

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createEmbedding
      path: create
    - type: object
      key: Embedding
      path: object
  - id: rerank
    title: Rerank
    description: 'Rerank a list of documents based on their relevance to a query. Reranking improves search results by scoring documents based on semantic relevance rather than keyword matching.


      Supported providers: Cohere, Voyage, Jina, Pinecone, Bedrock, Azure AI.

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createRerank
      path: create
    - type: object
      key: CreateRerankResponse
      path: object
  - id: fine-tuning
    title: Fine-tuning
    description: 'Manage fine-tuning jobs to tailor a model to your specific training data.


      Related guide: [Fine-tune models](https://platform.openai.com/docs/guides/fine-tuning)

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createFineTuningJob
      path: create
    - type: endpoint
      key: listPaginatedFineTuningJobs
      path: list
    - type: endpoint
      key: listFineTuningEvents
      path: list-events
    - type: endpoint
      key: listFineTuningJobCheckpoints
      path: list-checkpoints
    - type: endpoint
      key: retrieveFineTuningJob
      path: retrieve
    - type: endpoint
      key: cancelFineTuningJob
      path: cancel
    - type: object
      key: FinetuneChatRequestInput
      path: chat-input
    - type: object
      key: FinetuneCompletionRequestInput
      path: completions-input
    - type: object
      key: FineTuningJob
      path: object
    - type: object
      key: FineTuningJobEvent
      path: event-object
    - type: object
      key: FineTuningJobCheckpoint
      path: checkpoint-object
  - id: batch
    title: Batch
    description: 'Create large batches of API requests for asynchronous processing. The Batch API returns completions within 24 hours for a 50% discount.


      Related guide: [Batch](https://platform.openai.com/docs/guides/batch)

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createBatch
      path: create
    - type: endpoint
      key: retrieveBatch
      path: retrieve
    - type: endpoint
      key: cancelBatch
      path: cancel
    - type: endpoint
      key: listBatches
      path: list
    - type: object
      key: Batch
      path: object
    - type: object
      key: BatchRequestInput
      path: request-input
    - type: object
      key: BatchRequestOutput
      path: request-output
  - id: files
    title: Files
    description: 'Files are used to upload documents that can be used with features like [Assistants](https://platform.openai.com/docs/api-reference/assistants), [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning), and [Batch API](https://platform.openai.com/docs/guides/batch).

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createFile
      path: create
    - type: endpoint
      key: listFiles
      path: list
    - type: endpoint
      key: retrieveFile
      path: retrieve
    - type: endpoint
      key: deleteFile
      path: delete
    - type: endpoint
      key: downloadFile
      path: retrieve-contents
    - type: object
      key: OpenAIFile
      path: object
  - id: images
    title: Images
    description: 'Given a prompt and/or an input image, the model will generate a new image.


      Related guide: [Image generation](https://platform.openai.com/docs/guides/images)

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createImage
      path: create
    - type: endpoint
      key: createImageEdit
      path: createEdit
    - type: endpoint
      key: createImageVariation
      path: createVariation
    - type: object
      key: Image
      path: object
  - id: models
    title: Models
    description: 'List and describe the various models available in the API. You can refer to the [Models](https://platform.openai.com/docs/models) documentation to understand what models are available and the differences between them.

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: listModels
      path: list
    - type: endpoint
      key: retrieveModel
      path: retrieve
    - type: endpoint
      key: deleteModel
      path: delete
    - type: object
      key: Model
      path: object
  - id: moderations
    title: Moderations
    description: 'Given some input text, outputs if the model classifies it as potentially harmful across several categories.


      Related guide: [Moderations](https://platform.openai.com/docs/guides/moderation)

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createModeration
      path: create
    - type: object
      key: CreateModerationResponse
      path: object
  - id: assistants
    title: Assistants
    beta: true
    description: 'Build assistants that can call models and use tools to perform tasks.


      [Get started with the Assistants API](https://platform.openai.com/docs/assistants)

      '
    navigationGroup: assistants
    sections:
    - type: endpoint
      key: createAssistant
      path: cre

# --- truncated at 32 KB (38 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/portkey/refs/heads/main/openapi/portkey-logs-export-api-openapi.yml