Fastly Chat Completions API

The Chat Completions API from Fastly — 2 operation(s) for chat completions.

Documentation

📖
Documentation
https://www.fastly.com/documentation/reference/api/services/
📖
Documentation
https://www.fastly.com/documentation/reference/api/purging/
📖
Documentation
https://www.fastly.com/documentation/reference/api/logging/
📖
Documentation
https://www.fastly.com/documentation/reference/api/metrics-stats/
📖
Documentation
https://www.fastly.com/documentation/reference/api/tls/
📖
Documentation
https://www.fastly.com/documentation/reference/api/vcl-services/
📖
Documentation
https://www.fastly.com/documentation/reference/api/account/
📖
Documentation
https://www.fastly.com/documentation/reference/api/auth-tokens/
📖
Documentation
https://www.fastly.com/documentation/reference/api/acls/
📖
Documentation
https://www.fastly.com/documentation/reference/api/dictionaries/
📖
Documentation
https://www.fastly.com/documentation/guides/compute/
📖
Documentation
https://www.fastly.com/documentation/reference/api/ngwaf/
📖
Documentation
https://www.fastly.com/documentation/reference/api/domain-management/
📖
Documentation
https://www.fastly.com/documentation/reference/api/products/
📖
Documentation
https://www.fastly.com/documentation/reference/api/observability/
📖
Documentation
https://www.fastly.com/documentation/reference/api/api-security/
📖
Documentation
https://www.fastly.com/documentation/reference/api/ddos-protection/
📖
Documentation
https://www.fastly.com/documentation/reference/api/client-side-protection/
📖
Documentation
https://www.fastly.com/documentation/reference/api/publishing/
📖
Documentation
https://www.fastly.com/documentation/reference/api/load-balancing/
📖
Documentation
https://www.fastly.com/documentation/reference/api/utils/
📖
Documentation
https://www.fastly.com/products/ai
📖
Documentation
https://www.fastly.com/products/object-storage

Specifications

Other Resources

OpenAPI Specification

fastly-chat-completions-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Fastly Account ACL Chat Completions API
  description: The Fastly Account API provides endpoints for managing customer accounts, users, and identity and access management (IAM) resources. Developers can programmatically manage user invitations, roles, permissions, and service groups to control access to Fastly resources. The API supports retrieving and updating customer information, managing user profiles, and configuring organizational settings for enterprise accounts.
  version: '1.0'
  contact:
    name: Fastly Support
    url: https://support.fastly.com
  termsOfService: https://www.fastly.com/terms
servers:
- url: https://api.fastly.com
  description: Fastly API Production Server
security:
- apiKeyAuth: []
tags:
- name: Chat Completions
paths:
  /openai/v1/chat/completions:
    post:
      tags:
      - Chat Completions
      summary: Create Chat Completion Via OpenAI
      description: OpenAI-compatible chat completion request, semantically cached at the Fastly edge.
      operationId: createOpenAiChatCompletion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
      responses:
        '200':
          description: Chat completion response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
  /gemini/v1/models/{model}:generateContent:
    parameters:
    - in: path
      name: model
      required: true
      schema:
        type: string
        example: gemini-1.5-pro
    post:
      tags:
      - Chat Completions
      summary: Generate Content Via Google Gemini
      operationId: generateGeminiContent
      responses:
        '200':
          description: Gemini response
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
      - model
      - messages
      properties:
        model:
          type: string
          example: gpt-4o-mini
        messages:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                enum:
                - system
                - user
                - assistant
                - tool
              content:
                type: string
        temperature:
          type: number
          format: float
        max_tokens:
          type: integer
        stream:
          type: boolean
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
        created:
          type: integer
        model:
          type: string
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                type: object
                properties:
                  role:
                    type: string
                  content:
                    type: string
              finish_reason:
                type: string
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            completion_tokens:
              type: integer
            total_tokens:
              type: integer
        x_fastly_cache:
          type: object
          description: Fastly semantic cache metadata
          properties:
            status:
              type: string
              enum:
              - HIT
              - MISS
              - SIMILAR
            similarity:
              type: number
              format: float
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Fastly-Key
      description: API token used to authenticate requests to the Fastly API.
externalDocs:
  description: Fastly Account API Documentation
  url: https://www.fastly.com/documentation/reference/api/account/