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

# Embed URL content

> Embed website content from a specified URL, including child pages up to 5 levels deep within the same domain. The process crawls and loads content from the main URL and its linked pages into a Telnyx Cloud Storage bucket. As soon as each webpage is added to the bucket, its content is immediately processed for embeddings, that can be used for [similarity search](https://developers.telnyx.com/api-reference/embeddings/search-for-documents) and [clustering](https://developers.telnyx.com/docs/inference/clusters).



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/ai/analytics.yml post /ai/embeddings/url
openapi: 3.1.0
info:
  title: Telnyx AI Analytics API
  version: 2.0.0
  description: API for AI conversations, insights, embeddings, and clusters.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /ai/embeddings/url:
    post:
      tags:
        - Embeddings
      summary: Embed URL content
      description: >-
        Embed website content from a specified URL, including child pages up to
        5 levels deep within the same domain. The process crawls and loads
        content from the main URL and its linked pages into a Telnyx Cloud
        Storage bucket. As soon as each webpage is added to the bucket, its
        content is immediately processed for embeddings, that can be used for
        [similarity
        search](https://developers.telnyx.com/api-reference/embeddings/search-for-documents)
        and [clustering](https://developers.telnyx.com/docs/inference/clusters).
      operationId: PostEmbeddingUrl
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingUrlRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            const embeddingResponse = await client.ai.embeddings.url({
              bucket_name: 'bucket_name',
              url: 'url',
            });

            console.log(embeddingResponse.data);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            embedding_response = client.ai.embeddings.url(
                bucket_name="bucket_name",
                url="url",
            )
            print(embedding_response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tembeddingResponse, err := client.AI.Embeddings.URL(context.TODO(), telnyx.AIEmbeddingURLParams{\n\t\tBucketName: \"bucket_name\",\n\t\tURL:        \"url\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", embeddingResponse.Data)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
            import com.telnyx.sdk.models.ai.embeddings.EmbeddingResponse;
            import com.telnyx.sdk.models.ai.embeddings.EmbeddingUrlParams;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    EmbeddingUrlParams params = EmbeddingUrlParams.builder()
                        .bucketName("bucket_name")
                        .url("url")
                        .build();
                    EmbeddingResponse embeddingResponse = client.ai().embeddings().url(params);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


            telnyx = Telnyx::Client.new(api_key: "My API Key")


            embedding_response = telnyx.ai.embeddings.url(bucket_name:
            "bucket_name", url: "url")


            puts(embedding_response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $embeddingResponse = $client->ai->embeddings->url(
                bucketName: 'bucket_name', url: 'url'
              );

              var_dump($embeddingResponse);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx ai:embeddings url \
              --api-key 'My API Key' \
              --bucket-name bucket_name \
              --url url
components:
  schemas:
    EmbeddingUrlRequest:
      properties:
        url:
          type: string
          title: URL
          description: The URL of the webpage to embed
        bucket_name:
          type: string
          title: Bucket Name
          description: >-
            Name of the bucket to store the embeddings. This bucket must already
            exist.
      type: object
      required:
        - url
        - bucket_name
      title: EmbeddingUrlRequest
    EmbeddingResponse:
      properties:
        data:
          type: object
          properties:
            task_id:
              type: string
              format: uuid
              title: Task ID
            task_name:
              type: string
              title: Task Name
            status:
              type: string
              title: Status
            created_at:
              type: string
              title: Created At
            finished_at:
              type:
                - string
                - 'null'
              title: Finished At
            user_id:
              type: string
              format: uuid
              title: User ID
      type: object
      required:
        - data
      title: EmbeddingResponse
    HTTPValidationError:
      title: HTTPValidationError
      type: object
      properties:
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    ValidationError:
      title: ValidationError
      required:
        - loc
        - msg
        - type
      type: object
      properties:
        loc:
          title: Location
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````