DataCrunch OAuth API

The OAuth API from DataCrunch — 1 operation(s) for oauth.

OpenAPI Specification

datacrunch-oauth-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: DataCrunch Public Balance OAuth API
  description: Public REST API for DataCrunch, a European GPU cloud. The API lets you deploy and manage GPU/CPU instances, query instance types and real-time availability, manage OS images and startup scripts, SSH keys, block storage volumes, retrieve account balance, and deploy and operate serverless container deployments for inference. Authentication uses the OAuth 2.0 Client Credentials flow to obtain a short-lived Bearer access token.
  termsOfService: https://datacrunch.io/legal/terms-of-service
  contact:
    name: DataCrunch Support
    url: https://docs.datacrunch.io/
  version: '1.0'
servers:
- url: https://api.datacrunch.io/v1
security:
- bearerAuth: []
tags:
- name: OAuth
paths:
  /oauth2/token:
    post:
      operationId: createToken
      tags:
      - OAuth
      summary: Obtain an OAuth2 access token
      description: Exchange a client_id and client_secret for a Bearer access token using the OAuth 2.0 Client Credentials grant. Tokens are scoped to cloud-api-v1 and restricted to documented Public API endpoints.
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenRequest'
      responses:
        '200':
          description: Access token issued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    Unauthorized:
      description: Missing or invalid access token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    TokenResponse:
      type: object
      properties:
        access_token:
          type: string
        refresh_token:
          type: string
        token_type:
          type: string
          example: Bearer
        scope:
          type: string
          example: cloud-api-v1
        expires_in:
          type: integer
          example: 3600
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
    TokenRequest:
      type: object
      required:
      - grant_type
      - client_id
      - client_secret
      properties:
        grant_type:
          type: string
          enum:
          - client_credentials
        client_id:
          type: string
        client_secret:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer access token obtained from POST /oauth2/token via the OAuth 2.0 Client Credentials grant.