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

# Skill-Datei abrufen

> Rufe eine gespeicherte Skill-Datei anhand des Pfads ab

Ruft eine gespeicherte Skill-Datei anhand des Pfads aus deinem Workspace ab.

## Basis-URL

```
https://api.langdock.com/skills/v1/{skillId}/files
```

<Warning>
  **Dedicated Deployments**

  Ersetze `api.langdock.com` durch `<your-deployment-url>/api/public` in allen Anfragen.
</Warning>

## Erforderliche Scopes

Dieser Endpoint erfordert den `SKILL_API` Scope.

<Info>
  Erfordert Viewer-Zugriff auf den Skill.
</Info>

## Parameter

| Parameter | Typ    | Erforderlich | Beschreibung                                                                                                                                                                                     |
| --------- | ------ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `skillId` | string | Ja           | UUID des abzurufenden Skills.                                                                                                                                                                    |
| `path`    | string | Ja           | Relativer Pfad der Datei im Skill, zum Beispiel `references/template.md`. Maximum: 255 Zeichen. Absolute Pfade, Pfade mit Laufwerksbuchstaben, Steuerzeichen und `..`-Segmente werden abgelehnt. |

Die Datei muss gültiges UTF-8 sein und darf höchstens 512 KB groß sein. Lesbare Endungen sind `.md`, `.mdx`, `.txt`, `.py`, `.sh`, `.js`, `.ts`, `.json`, `.yaml`, `.yml`, `.toml`, `.csv`, `.xml`, `.xsd`, `.html`, `.css` und `.svg`. Binärdateien und andere nicht unterstützte Dateien bleiben unter [Skill abrufen](/de/developer/skills-api/get-skill) gelistet. Dieser Endpoint gibt ihren Inhalt nicht zurück.

## Beispiel

```javascript theme={null}
const axios = require("axios");

async function getSkillFile(skillId, path) {
  const response = await axios.get(
    `https://api.langdock.com/skills/v1/${skillId}/files`,
    {
      params: { path },
      headers: {
        Authorization: "Bearer YOUR_API_KEY"
      }
    }
  );

  console.log("Content:", response.data.content);
}

getSkillFile(
  "550e8400-e29b-41d4-a716-446655440000",
  "references/template.md"
);
```

## Antwortformat

### Erfolgsantwort (200 OK)

```typescript theme={null}
{
  path: string;
  sizeBytes: number;
  extension: string;
  hasScript: boolean;
  sha256: string;
  content: string;
}
```

## Fehlerbehandlung

| Statuscode | Beschreibung                                                                                                     |
| ---------- | ---------------------------------------------------------------------------------------------------------------- |
| 400        | Ungültige Skill-ID, ungültiger Pfad, nicht unterstützter Dateityp, ungültiges UTF-8 oder Datei größer als 512 KB |
| 401        | Ungültiger oder fehlender API Key                                                                                |
| 403        | Fehlender `SKILL_API` Scope oder kein Skills-Produktzugriff                                                      |
| 404        | Skill oder Datei nicht gefunden oder nicht zugänglich                                                            |
| 429        | Rate Limit überschritten                                                                                         |
| 500        | Interner Serverfehler                                                                                            |

<Info>
  Langdock blockiert bewusst Browser-basierte Anfragen, um deinen API-Schlüssel zu schützen und die Sicherheit deiner Anwendungen zu gewährleisten. Weitere Informationen findest du in unserem Guide zu [Best Practices für API-Schlüssel](/de/admin/ai-adoption-and-rollout/best-practices/api-key-best-practices).
</Info>


## OpenAPI

````yaml GET /skills/v1/{skillId}/files
openapi: 3.0.0
info:
  title: Langdock API
  version: 3.0.0
servers:
  - url: https://api.langdock.com
    description: Production
security:
  - bearerAuth: []
paths:
  /skills/v1/{skillId}/files:
    get:
      tags:
        - Skills
      summary: Get a Skill file
      description: Retrieves a stored Skill file by path from your workspace.
      operationId: getSkillFile
      parameters:
        - $ref: '#/components/parameters/SkillId'
        - name: path
          in: query
          required: true
          description: Relative path of the file inside the Skill.
          schema:
            type: string
            minLength: 1
            maxLength: 255
      responses:
        '200':
          description: File returned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkillFileContent'
        '400':
          description: >-
            Invalid Skill ID, invalid path, unsupported file type, invalid
            UTF-8, or file larger than 512 KB
        '401':
          description: Invalid or missing API key
        '403':
          description: Missing required scope or access
        '404':
          description: Skill or file not found
        '429':
          description: Rate limit exceeded
        '500':
          description: Internal server error
components:
  parameters:
    SkillId:
      name: skillId
      in: path
      required: true
      description: UUID of the Skill.
      schema:
        type: string
        format: uuid
  schemas:
    SkillFileContent:
      allOf:
        - $ref: '#/components/schemas/SkillFile'
        - type: object
          required:
            - content
          properties:
            content:
              type: string
              description: UTF-8 file contents.
    SkillFile:
      type: object
      required:
        - path
        - sizeBytes
        - extension
        - hasScript
        - sha256
      properties:
        path:
          type: string
          description: Relative path inside the Skill.
        sizeBytes:
          type: integer
          description: File size in bytes.
        extension:
          type: string
          description: Lowercase file extension, including the leading dot.
        hasScript:
          type: boolean
          description: Whether the file is a script file (`.py`, `.sh`, `.js`, or `.ts`).
        sha256:
          type: string
          description: Lowercase SHA-256 hash of the original file bytes.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key as Bearer token. Format "Bearer YOUR_API_KEY"

````