> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gbox.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Set screen resolution

> Set the screen resolution



## OpenAPI

````yaml post /boxes/{boxId}/resolution
openapi: 3.0.0
info:
  title: GBOX Open API
  description: GBOX Open API Documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://gbox.ai/api/v1
    description: Production Server
security: []
tags: []
paths:
  /boxes/{boxId}/resolution:
    post:
      tags:
        - Box
      summary: Set screen resolution
      description: Set the screen resolution
      operationId: BoxMiscController_setScreenResolution
      parameters:
        - name: boxId
          required: true
          in: path
          description: Box ID
          schema:
            example: c9bdc193-b54b-4ddb-a035-5ac0c598d32d
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetScreenResolution'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Resolution'
      security:
        - bearer: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import GboxSDK from "gbox-sdk";

            const gboxSDK = new GboxSDK({
              apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
            });

            async function main() {
              const box = await gboxSDK.create({ type: "linux" });

              // Set box resolution
              const newResolution = await box.resolution.set({ width: 1024, height: 768 });

              console.log("New resolution:", newResolution);
            }

            main();
        - lang: Python
          source: |-
            import os
            from gbox_sdk import GboxSDK

            def main():
                gbox_sdk = GboxSDK(api_key=os.environ["GBOX_API_KEY"])  # This is the default and can be omitted

                # Create Linux box
                box = gbox_sdk.create(type="linux")

                # Set box resolution
                new_resolution = box.resolution.set(width=1024, height=768)

                print(f"New resolution: {new_resolution}")

            if __name__ == "__main__":
                main()
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/gbox/gbox-sdk-go\"\n)\n\nfunc main() {\n\tgboxSDK := gbox.NewGboxSDK(os.Getenv(\"GBOX_API_KEY\")) // This is the default and can be omitted\n\n\t// Create Linux box\n\tbox, err := gboxSDK.Create(context.Background(), gbox.CreateRequest{Type: \"linux\"})\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to create box: %v\", err)\n\t}\n\n\t// Set box resolution\n\tnewResolution, err := box.Resolution.Set(context.Background(), gbox.SetResolutionRequest{\n\t\tWidth:  1024,\n\t\tHeight: 768,\n\t})\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to set resolution: %v\", err)\n\t}\n\n\tfmt.Printf(\"New resolution: %+v\\n\", newResolution)\n}"
components:
  schemas:
    SetScreenResolution:
      type: object
      properties:
        width:
          type: number
          description: The width of the screen
          example: 1920
        height:
          type: number
          description: The height of the screen
          example: 1080
      title: Set Screen Resolution
      description: Set the screen resolution
      required:
        - width
        - height
    Resolution:
      type: object
      properties:
        width:
          type: number
          description: Width of the screen
          title: Resolution
          example: 1920
        height:
          type: number
          description: Height of the screen
          title: Resolution
          example: 1080
      title: Resolution
      description: Resolution configuration
      required:
        - width
        - height
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: >-
        Enter your API Key in the format: Bearer <token>. Get it from
        https://gbox.ai

````