For the complete documentation index, see llms.txt. This page is also available as Markdown.

API guide

API fundamentals

  • Each text analysis in the Smabbler API is a separate unit, which is identified by a unique OperationId. Currently, the API supports only a single text analysis per operation / request.

  • Text analysis using the Smabbler API is done asynchronously, by sending separate REST requests for initializing the analysis and acquiring the results separately.

  • Access to the API is granted via an API key, which is assigned to a Smabbler Portal Account. More details can be found in the API key section.

  • The analysis can be done using your custom built model.

  • There are certain API limits and quotas.


API endpoints

The Smabbler API has 23 endpoints divided into 6 groups:

  • /source

    • /source/file (POST)

      • Uploads a new source (e.g., text or CSV file) for analysis.

      • Parameters:

        • SourceFile (required): The file to upload. It must be in .txt or .csv format. Maximum file size is 400 MB.

        • tags (optional): tags of the source; at most 20, each up to 50 characters, no duplicates.

      • A response containing a unique identifier of the source: sourceId.

    • /source/{sourceId} (GET)

      • Retrieves details for a specific source.

      • Parameters:

        • sourceId: The unique identifier of the source to retrieve.

      • Returns source details: sourceId, status, fileName, size (in bytes), createDate, modifiedAt, efficiency and tags.

  • /sources (GET)

    • Retrieves a paginated list of all available sources.

    • Parameters:

      • page (query, optional): Page number (default: 0).

      • pageSize (query, optional): Number of items per page (default: 10).

      • status (query, optional): Source status, for example Analyzed. Matches the whole status and ignores case.

    • Returns a paginated list of source objects. Each item contains: sourceId, status, fileName, size (in bytes), createDate, modifiedAt, efficiency and tags. Pagination metadata: totalCount, page, pageSize. totalCount is the number of sources that match the filters.

  • /source/{sourceId}/analyze/txt (POST)

    • Initiates a text analysis operation for the specified source. A source that is already analyzed, queued or being analyzed is not analyzed again.

    • Parameters:

      • sourceId: Identifier of the source to analyze.

  • /source/{sourceId}/analyze/csv (POST)

    • Analyzes the content of a CSV source with specific column configurations. A source that is already analyzed, queued or being analyzed is not analyzed again. Every row must have a value in the ID column; otherwise the whole source is rejected and its analysis fails.

    • Parameters:

      • sourceId: Identifier of the source to analyze.

      • idColumnName (body): Name of the column containing unique IDs.

      • textColumnNames (body): List of column names containing text to analyze (comma-separated).

  • /source/{sourceId} (DELETE)

    • Deletes the given source permanently.

    • Parameters:

      • sourceId: Identifier of the source to delete.

  • /model

    • /model/build (POST)

      • Builds a custom model using the provided sources.

      • Parameters:

        • sourceIds (body): List of analyzed source identifiers (coma separated) to use for building the model.

        • modelName (body): Name of the model to create.

      • Returns new model identifier.

    • /model/{modelId} (GET)

      • Retrieves details about a specific custom model.

      • Parameters:

        • modelId: Unique identifier of the model to retrieve.

      • Returns model details: modelId, modelName, status, modifiedDate, a history array (each entry contains date and description of a status change), and a sources array (each entry contains sourceId and fileName of a source currently attached to the model).

    • /models (GET)

      • Retrieves a list of all available custom models.

      • Parameters:

        • page (query, optional): Page number for results (default: 0).

        • pageSize (query, optional): Number of items per page (default: 10).

        • status (query, optional): Model status, for example Active. Matches the whole status and ignores case.

        • name (query, optional): Part of the model name. Ignores case.

      • Returns a paginated list of model objects. Each item contains: modelId, modelName, status, and modifiedDate. Pagination metadata: totalCount, page, pageSize. totalCount is the number of models that match the filters.

    • /model/{modelId}/activate (POST)

      • Activates a specific custom model, making it available for use.

      • Parameters:

        • modelId: Identifier of the model to activate.

    • /model/{modelId}/deactivate (POST)

      • Deactivates the specified custom model.

      • Parameters:

        • modelId: Identifier of the model to deactivate.

    • /model/{modelId}/sources (PATCH)

      • Adds or removes sources from a specific custom model.

      • Parameters:

        • modelId (route): Unique identifier of the model to update.

        • add (body): List of source identifiers to add to the model.

        • remove (body): List of source identifiers to remove from the model.

      • At least one of add or remove must be non-empty.

      • Returns updated model details: modelId, modelName and status.

    • /model/{modelId} (DELETE)

      • Deletes the specified custom model permanently.

      • Parameters:

        • modelId: Identifier of the model to delete.

  • /analyze

    • /analyze/initialize (POST) - used to initialize text analysis. Requires the text to be analyzed and a language model identifier as a parameter. Returns a unique OperationId analysis identifier.

      • Parameters:

        • modelId (body): name/identifier of model.

        • text (body): text to analyze, max length: 2,000,000 characters.

      • Returns operationId - analysis identifier.

    • /analyze/{operationId}/status (GET) - returns the status of the text analysis. Requires the OperationId identifier as a parameter.

      • Parameters:

        • operationId (query): analysis identifier.

      • Returns analysis status.

    • /analyze/{operationId}/result (GET) - returns the result of the text analysis (if available). Requires the OperationId identifier as a parameter.

      • Parameters:

        • operationId (query): analysis identifier.

      • Returns analysis result.

    • /analyze/sharded/initialize (POST) - used to initialize a sharded text analysis across multiple models simultaneously. This allows for parallel processing and result aggregation from different models. Returns a unique OperationId identifier.

      • Parameters:

        • modelsIds (body): list of model identifiers (e.g., ["id1", "id2"]).

        • text (body): text to analyze, max length: 2,000,000 characters.

  • /agent/conversation

    • /agent/conversation/initialize (POST) - initializes a new agent conversation operation. Returns a unique OperationId identifier.

      • Parameters:

        • question (body): the primary question to be addressed by the agent.

        • subqueries (body): number of subqueries represented as a word. OriginalQuery = no subqueries, only original question will be used; TwoSubqueries and ThreeSubqueries represent respective number of 2 or 3 subqueries sent to Smabbler models.

        • modelsIds (body): list of model identifiers to be used for the conversation.

        • planningHints (body, optional): free-text guidance for the planning step, up to 1000 characters. No effect with OriginalQuery.

        • synthesisHints (body, optional): free-text guidance for the synthesis step, up to 1000 characters.

        • history (body, optional): earlier turns of the same conversation, oldest first, each with question and answer. At most 10 turns; with two or more turns, all questions and answers together may not exceed 1000 characters.

      • Returns operationId - conversation identifier.

    • /agent/conversation/{operationId}/status (GET) - retrieves the current status of the conversation operation.

      • Parameters:

        • operationId: unique identifier of the conversation operation.

      • Returns conversation status and an associated message.

    • /agent/conversation/{operationId}/result (GET) - returns the high-level result of the conversation analysis.

      • Parameters:

        • operationId: unique identifier of the conversation operation.

      • Returns status, message and answer, the final answer as a Markdown string.

    • /agent/conversation/{operationId}/result/detailed (GET) - provides a comprehensive and detailed result of the conversation, including underlying analysis steps.

      • Parameters:

        • operationId: unique identifier of the conversation operation.

      • Returns the planned subQueries and shardingResults with the analysis result of each queried model.

  • /openapi

    • /openapi (GET) - provides the complete OpenAPI definition of the Smabbler API, including specifications of all available endpoints, request and response formats.

  • /account

    • /account/gcu (GET) - returns the number of GCUs still available for the account associated with the request's API key. GCUs are consumed while models are active. Use this endpoint to check how much of your balance is left.

      • Parameters:

        • This endpoint takes no query, path or body parameters. The account is resolved from the x-api-key header.

      • Returns:

        • remainingGcus (number): the amount of GCUs currently available for the account. Returned as a floating-point value (e.g. 1250.0).

      • Possible responses: 200 OK - GCU information retrieved successfully. 404 Not Found - no active subscription found for the account ("No active subscription found"). 500 Internal Server Error - "Cannot retrieve GCU information for the account".

The base API URL is shown in the Smabbler Portal: open the Account page and find API Url in the API section, which has a copy button.


Errors

When a request fails, the API answers with an HTTP error status and a JSON body in the problem details format (application/problem+json) with type, title, status, detail and instance, plus trace information that identifies the request.

  • 400 Bad Request - the request is not valid, for example a required parameter is missing or a file cannot be processed. detail says what is wrong.

  • 401 Unauthorized - the API key is missing or not valid. See API key.

  • 404 Not Found - the source, model or operation does not exist in your account.

  • 429 Too Many Requests - more requests than the limits allow. Wait and send the request again.

  • 500 Internal Server Error - the request failed on our side. Try again later. If it keeps failing, contact support and include the trace information from the response.

API key

Access to the Smabbler API is granted via an API Key. Each request must have an API key value set as x-api-key header value.

The API key is assigned to a Smabbler account. To find it, click your username in the bottom-left, then select Account.

Please note that the API key is secret and must be treated appropriately to minimize the risk of leakage. However, if you suspect that your API key has been compromised, you can roll your API key. Key roll will invalidate the current one and generate new key value. API Key roll can be done in Smabbler Portal -> Account page.

By default, API key has an infinite lifetime. It can be disabled in two cases:

  • if the key has been rolled,

  • if your subscription has expired or ended, or your GCU balance has run out. The key works again after you buy GCUs.


How to get the API Key?

To get your API key go to the Account page (click your username in the bottom-left, then select Account). The API key can be found in the API section.

If everything is OK, the key status should be Active. The key value can be viewed or copied using built-in buttons:

API section of the Account page with an active key

If your subscription is not active, the key status is Inactive. Not Available means that no key has been created for your account yet.

How to roll the API Key?

If you suspect that your API key has leaked or been compromised, you should roll the key.

Doing so will invalidate your current API key and create a new one.

To roll the API key, open the Account page and click Roll API Key in the API section.

A confirmation window shows your current key. Click Yes to roll it, or No to keep it:

Confirmation window before the API key is rolled

After that, the key status changes to Pending for a few moments, until the new key is available.

Please note that the API key creation timestamp will also update, which can be used for key identification.


Analysis statuses

There are five valid analysis statuses:

  • initialized -> the analysis was initialized

  • assigned -> the analysis was assigned to a processing node and is waiting to be processed

  • processed -> the analysis was processed and results are waiting

  • failed -> the analysis failed due to a reason mentioned in the message part of the response

  • unknown -> the status of the analysis is unknown.

During normal operation, four statuses (initialized | assigned | processed | failed) are used to represent the state of the analysis.

The unknown status is given only in case of the most critical issues and usually requires contacting support.


Limits and quotas

There are the following limits and quotas for API usage:

  • max 10 requests per second

  • max 100000 requests per month

  • max analyzed text length (sent in the /analyze/initialize request) - 2000000 characters.


API Billing

API usage is based on GCUs, which are consumed while models are active. For full details about GCUs, free trial access and purchasing credits, see the Account & Access section.

Last updated