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

# Create Agent From Config

> Create a config-based agent, optionally deploying it.

Set deploy=false to save as draft without deploying.



## OpenAPI

````yaml /openapi/openapi.json post /agents/config
openapi: 3.1.0
info:
  title: Streamkap REST API
  description: >-
    The Streamkap REST API allows you to programmatically manage your CDC
    pipelines, sources, destinations, transforms, and more.


    Authenticate using a bearer token obtained from the [Access
    Token](/api-reference/auth/access-token) endpoint with your API client
    credentials.
  contact:
    name: Streamkap Support
    url: https://streamkap.com/
    email: support@streamkap.com
  license:
    name: Proprietary
  version: 2.0.0
servers:
  - url: https://api.streamkap.com
    description: Production
security: []
tags:
  - name: Agents
    description: Create, deploy, and manage Flink-based AI agents.
  - name: Agents Observability
    description: >-
      Read-only views over the MCP audit log: agent rollup, sessions, spans,
      histograms, external-agent verify.
  - name: Alerts
    description: Manage alert subscribers, preferences, and notification credentials.
  - name: Authentication
    description: Obtain and refresh access tokens, manage client credentials and roles.
  - name: Billing
    description: Retrieve usage metrics, summaries, and export billing data.
  - name: Consumer Groups
    description: List, inspect, and reset Kafka consumer group offsets.
  - name: Dashboard
    description: Retrieve organisation-level statistics and overview data.
  - name: Destinations
    description: Create, configure, and manage data destinations and their lifecycle.
  - name: Kafka Access
    description: Manage Kafka users and their access permissions.
  - name: Logs
    description: Query and summarise system logs.
  - name: Pipelines
    description: Create, configure, and manage CDC pipelines and their lifecycle.
  - name: Project Keys
    description: Manage project keys that bundle API credentials and optional Kafka access.
  - name: Schema Registry
    description: Browse schema subjects, versions, and retrieve schema definitions.
  - name: Services
    description: View and switch service metadata.
  - name: Sources
    description: >-
      Create, configure, and manage data sources, snapshots, and their
      lifecycle.
  - name: Tags
    description: Create, update, and manage resource tags for organisation.
  - name: Topics
    description: Browse topic details, statistics, configurations, metrics, and messages.
  - name: Transforms
    description: >-
      Create, deploy, and manage data transforms, unit tests, and implementation
      details.
paths:
  /agents/config:
    post:
      tags:
        - Agents
      summary: Create Agent From Config
      description: |-
        Create a config-based agent, optionally deploying it.

        Set deploy=false to save as draft without deploying.
      operationId: createAgentFromConfig
      parameters:
        - name: deploy
          in: query
          required: false
          schema:
            type: boolean
            default: true
            title: Deploy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAgentConfigRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/app__models__api__agents_api_models__flink_jobs__FlinkJobResponse
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - FronteggHTTPAuthentication: []
components:
  schemas:
    CreateAgentConfigRequest:
      properties:
        name:
          type: string
          maxLength: 200
          minLength: 1
          title: Name
          description: Agent display name
        description:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Description
          description: Human-readable context for the agent
        enabled:
          type: boolean
          title: Enabled
          description: >-
            Kill switch. When false, the Flink runtime accepts the deploy but
            stops emitting output — used by support to disable a runaway tenant
            agent without a full cancel/redeploy.
          default: true
        agentType:
          $ref: '#/components/schemas/AgentTypeEnum'
          description: >-
            Agent type — derived from the tool list post-validation;
            client-supplied value is overwritten
          default: workflow
        input:
          $ref: '#/components/schemas/AgentInputConfig'
        output:
          $ref: '#/components/schemas/AgentOutputConfig'
        llm:
          $ref: '#/components/schemas/AgentLlmConfig'
        prompts:
          $ref: '#/components/schemas/AgentPromptConfig'
        mcpServer:
          anyOf:
            - $ref: '#/components/schemas/AgentMcpServerConfig'
            - type: 'null'
          description: Shared MCP server config for all MCP tools
        tools:
          items:
            $ref: '#/components/schemas/AgentToolConfig'
          type: array
          title: Tools
          description: Agent tools (MCP, HTTP, transform)
        memory:
          anyOf:
            - $ref: '#/components/schemas/AgentMemoryConfig'
            - type: 'null'
          description: Memory config (short-term + long-term)
        knowledgeBases:
          items:
            $ref: '#/components/schemas/AgentKnowledgeBaseRef'
          type: array
          maxItems: 10
          title: Knowledgebases
          description: Knowledge bases this agent can query at runtime for RAG
        processing:
          $ref: '#/components/schemas/AgentProcessingConfig'
      additionalProperties: false
      type: object
      required:
        - name
        - input
        - output
        - llm
        - prompts
      title: CreateAgentConfigRequest
      description: Request body for POST /agents/config - create a config-based agent.
    app__models__api__agents_api_models__flink_jobs__FlinkJobResponse:
      properties:
        _id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        job_type:
          $ref: >-
            #/components/schemas/app__models__api__agents_api_models__flink_jobs__FlinkJobTypeEnum
        status:
          $ref: '#/components/schemas/FlinkJobStatusEnum'
        desired_status:
          anyOf:
            - $ref: '#/components/schemas/FlinkJobStatusEnum'
            - type: 'null'
        flink_job_name:
          type: string
          title: Flink Job Name
        flink_job_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Flink Job Id
        parallelism:
          type: integer
          title: Parallelism
          default: 1
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        agent_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Agent Config
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
        created_timestamp:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created Timestamp
        updated_timestamp:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated Timestamp
      additionalProperties: true
      type: object
      required:
        - _id
        - name
        - job_type
        - status
        - flink_job_name
      title: FlinkJobResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentTypeEnum:
      type: string
      enum:
        - workflow
        - react
      title: AgentTypeEnum
    AgentInputConfig:
      properties:
        topicPattern:
          type: string
          maxLength: 1024
          minLength: 1
          title: Topicpattern
          description: Regex pattern for input topics, e.g. '^(orders)$'
        inputSerialization:
          $ref: '#/components/schemas/AgentSerializationEnum'
          description: Input deserialization format
          default: JsonConfluent
        fields:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Fields
          description: Column-level filter - only these fields sent to LLM
        createTableSQL:
          anyOf:
            - type: string
              maxLength: 4000
            - type: 'null'
          title: Createtablesql
          description: Flink SQL CREATE TABLE (required if filterSQL is set)
        filterSQL:
          anyOf:
            - type: string
              maxLength: 4000
            - type: 'null'
          title: Filtersql
          description: WHERE clause predicate for row-level filtering
      additionalProperties: false
      type: object
      required:
        - topicPattern
      title: AgentInputConfig
      description: Input configuration for the agent.
    AgentOutputConfig:
      properties:
        topic:
          type: string
          maxLength: 249
          minLength: 1
          title: Topic
          description: Fixed output topic name
        deadLetterTopic:
          anyOf:
            - type: string
              maxLength: 249
            - type: 'null'
          title: Deadlettertopic
          description: DLQ topic name
        outputSerialization:
          $ref: '#/components/schemas/AgentSerializationEnum'
          description: Output serialization format
          default: JsonConfluent
        schema:
          additionalProperties:
            $ref: '#/components/schemas/AgentOutputSchemaTypeEnum'
          type: object
          title: Schema
          description: 'Output schema: {field_name: TYPE_STRING}'
      additionalProperties: false
      type: object
      required:
        - topic
      title: AgentOutputConfig
      description: Output configuration for the agent.
    AgentLlmConfig:
      properties:
        provider:
          $ref: '#/components/schemas/AgentLlmProviderEnum'
          description: LLM provider
        model:
          type: string
          minLength: 1
          title: Model
          description: Model name, e.g. claude-sonnet-4-20250514
        apiKey:
          type: string
          maxLength: 512
          title: Apikey
          description: >-
            API key - use '${SECRET:ENV_VAR_NAME}' for env var resolution. Empty
            when llmConnectionId is set.
          default: ''
        llmConnectionId:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Llmconnectionid
          description: >-
            Tenant-scoped reference to
            ``agent_connections.llmConnections[].id``. When set with an empty
            ``apiKey``, the BE resolves the real key server-side at deploy and
            at test-run.
        baseUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Baseurl
          description: Base URL for OpenAI-compatible proxies
        temperature:
          anyOf:
            - type: number
              maximum: 2
              minimum: 0
            - type: 'null'
          title: Temperature
          description: Sampling temperature (null = matrix-skipped)
        maxTokens:
          anyOf:
            - type: integer
              maximum: 100000
              minimum: 1
            - type: 'null'
          title: Maxtokens
          description: Max output tokens (null = matrix-skipped)
        timeout:
          anyOf:
            - type: integer
              maximum: 600
              minimum: 1
            - type: 'null'
          title: Timeout
          description: Request timeout in seconds (null = matrix-skipped)
        reasoningEffort:
          anyOf:
            - type: string
              enum:
                - none
                - minimal
                - low
                - medium
                - high
                - xhigh
            - type: 'null'
          title: Reasoningeffort
          description: >-
            OpenAI / GPT-5 reasoning effort. The accepted set is per-model: the
            matrix in app/utils/llm_capabilities.py rejects values not in
            caps.reasoning_effort_values for the chosen provider+model.
        thinkingBudgetTokens:
          anyOf:
            - type: integer
              maximum: 64000
              minimum: 0
            - type: 'null'
          title: Thinkingbudgettokens
          description: >-
            Anthropic Claude 4 extended-thinking budget (tokens). Non-null
            enables thinking.
        ollamaThink:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Ollamathink
          description: Ollama 'think' toggle for reasoning models
        maxRetries:
          anyOf:
            - type: integer
              maximum: 20
              minimum: 0
            - type: 'null'
          title: Maxretries
          description: >-
            Universal — max retry attempts on LLM call. Accepted by every
            provider.
        region:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Region
          description: >-
            Bedrock: AWS region (e.g. us-east-1). Ignored for non-bedrock
            providers.
        strict:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Strict
          description: 'openai-responses: enable JSON-schema strict mode.'
        store:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Store
          description: 'openai-responses: server-side response storage flag.'
        instructions:
          anyOf:
            - type: string
              maxLength: 8192
            - type: 'null'
          title: Instructions
          description: >-
            openai-responses: system-level instructions passed as a top-level
            Responses param.
        additionalKwargs:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Additionalkwargs
          description: >-
            openai-responses / azure-openai: free-form extra request params
            forwarded verbatim by the runtime.
        apiVersion:
          anyOf:
            - type: string
              maxLength: 32
            - type: 'null'
          title: Apiversion
          description: >-
            azure-openai: Azure OpenAI API version (e.g. '2024-02-01'). Required
            for azure-openai.
        azureEndpoint:
          anyOf:
            - type: string
              maxLength: 512
            - type: 'null'
          title: Azureendpoint
          description: >-
            azure-openai: Azure resource endpoint (e.g.
            https://<resource>.openai.azure.com). Required.
        azureUrlPathMode:
          anyOf:
            - type: string
              enum:
                - AUTO
                - LEGACY
                - UNIFIED
            - type: 'null'
          title: Azureurlpathmode
          description: >-
            azure-openai: URL path resolution — AUTO / LEGACY / UNIFIED.
            Optional.
      additionalProperties: false
      type: object
      required:
        - provider
        - model
      title: AgentLlmConfig
      description: |-
        Inline LLM configuration embedded on the agent.

        Carries provider, credentials, model, and tuning controls as a single
        blob. The FE prefills the form from a saved :class:`AgentLlmConnection`
        (which now carries default model + tuning + reasoning controls) and
        the user can override per-agent before save; the resulting blob is
        stored verbatim and shipped to the Flink runtime at deploy.

        Two credential shapes (XOR, mirrors :class:`ValidateLlmRequest`):

        1. **Inline** - ``apiKey`` is filled directly. The BE KMS-encrypts it
           at save and decrypts it at deploy / test-run.
        2. **Linked** - ``llmConnectionId`` references a row in
           ``agent_connections.llmConnections`` and ``apiKey`` is left empty.
           The BE resolves the real key server-side at deploy and at test-run
           via :func:`agents_service.resolve_saved_llm_credentials`, so the
           browser never needs to hold (or re-paste) the stored plaintext when
           editing an existing agent.

        ``provider == ollama`` accepts an empty key without a link (the
        runtime is local and unauthenticated).
    AgentPromptConfig:
      properties:
        system:
          type: string
          maxLength: 8000
          title: System
          description: Assembled system prompt (auto-generated by backend)
          default: ''
        customInstructions:
          type: string
          maxLength: 8000
          title: Custominstructions
          description: User-provided instructions appended to the auto-generated prompt
          default: ''
        user:
          type: string
          maxLength: 2000
          title: User
          description: >-
            User prompt template - {input_json} is replaced with the input
            record
          default: <record>{input_json}</record>
      additionalProperties: false
      type: object
      title: AgentPromptConfig
      description: >-
        Prompt configuration for the agent.


        The final system prompt is auto-assembled by ``build_system_prompt()``
        from the

        agent type template + output schema + tool descriptions +
        custom_instructions.

        The ``system`` field stores the assembled result (set by the backend,
        not the user).
    AgentMcpServerConfig:
      properties:
        projectKeyId:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Projectkeyid
          description: >-
            ID of an agentic-enabled Project Key. When set, deploy-time resolves
            the Streamkap MCP serverUrl + auth header from the PK row. Mutually
            exclusive with serverUrl - one or the other, never both.
        serverUrl:
          anyOf:
            - type: string
              maxLength: 2048
              minLength: 1
            - type: 'null'
          title: Serverurl
          description: >-
            External MCP server URL. Required when projectKeyId is unset.
            Server-stamped from the PK row when projectKeyId is set.
        headers:
          additionalProperties:
            type: string
          type: object
          maxProperties: 32
          title: Headers
          description: Auth headers for MCP server
      additionalProperties: false
      type: object
      title: AgentMcpServerConfig
      description: >-
        Top-level MCP server config shared across all MCP tools.


        Two shapes (hard cutover):


        - **Streamkap MCP** (internal toolbelt): ``projectKeyId`` set,
        ``serverUrl``
          and ``headers`` resolved server-side at deploy time from the agentic-enabled
          Project Key. The legacy "saved Streamkap MCP card" path (match-by-serverUrl
          against ``agent_connections.mcpConnections[source==streamkap]``) is gone.
        - **External MCP**: ``serverUrl`` + ``headers`` set inline;
        ``projectKeyId``
          omitted. Headers are still composed at deploy time from the matching
          saved external connection (bearer / custom-header).
    AgentToolConfig:
      properties:
        name:
          type: string
          maxLength: 100
          minLength: 1
          title: Name
          description: Tool name (must be unique)
        type:
          $ref: '#/components/schemas/AgentToolTypeEnum'
          description: 'Tool type: http, transform, or mcp'
        description:
          type: string
          maxLength: 2000
          title: Description
          description: Tool description for the LLM
          default: ''
        config:
          additionalProperties: true
          type: object
          title: Config
          description: Type-specific configuration
        parameters:
          items:
            $ref: '#/components/schemas/AgentToolParameterConfig'
          type: array
          title: Parameters
          description: Tool parameters the LLM can provide
      additionalProperties: false
      type: object
      required:
        - name
        - type
      title: AgentToolConfig
      description: |-
        A single tool definition in the agent config.

        ``name`` and ``description`` are concatenated into the assembled system
        prompt by ``build_system_prompt()`` and shipped to Flink as part of the
        ``--agentConfig`` CLI argument. Length caps here keep the worst-case
        serialized agentConfig within the Flink CLI ~64KB single-arg budget even
        with many tools configured.
    AgentMemoryConfig:
      properties:
        keyField:
          anyOf:
            - type: string
            - type: 'null'
          title: Keyfield
          description: >-
            Field to partition memory by (e.g. 'customer_id'). Default: topic
            key
        shortTerm:
          $ref: '#/components/schemas/AgentShortTermMemoryConfig'
          description: Short-term conversation memory
        longTerm:
          $ref: '#/components/schemas/AgentLongTermMemoryConfig'
          description: Long-term vector store memory
      additionalProperties: false
      type: object
      title: AgentMemoryConfig
      description: Memory configuration for the agent.
    AgentKnowledgeBaseRef:
      properties:
        id:
          type: string
          maxLength: 64
          minLength: 1
          title: Id
          description: Knowledge base entity ID
        name:
          type: string
          maxLength: 200
          title: Name
          description: Display name (denormalized for UI)
          default: ''
      additionalProperties: false
      type: object
      required:
        - id
      title: AgentKnowledgeBaseRef
      description: >-
        Reference to a Knowledge Base that an agent can query at runtime for
        RAG.


        Stored on the agent config. At deploy time, the BE resolves each ref to
        the

        KB's vector store + embedding credentials and injects them into the
        Flink

        agentConfig JSON.
    AgentProcessingConfig:
      properties:
        parallelism:
          type: integer
          maximum: 128
          minimum: 1
          title: Parallelism
          description: Parallelism
          default: 1
        checkpointIntervalMin:
          type: integer
          maximum: 60
          minimum: 1
          title: Checkpointintervalmin
          description: Checkpoint interval in minutes
          default: 5
        maxIterations:
          type: integer
          maximum: 25
          minimum: 1
          title: Maxiterations
          description: Max tool-call iterations per record (react type only)
          default: 10
        maxTokensPerHour:
          type: integer
          minimum: 0
          title: Maxtokensperhour
          description: >-
            Per-TaskManager rolling-hour token budget. 0 = unlimited. When
            exceeded, records pass through with a `_budget_exceeded: true`
            marker.
          default: 0
      additionalProperties: false
      type: object
      title: AgentProcessingConfig
      description: Processing configuration for the agent.
    app__models__api__agents_api_models__flink_jobs__FlinkJobTypeEnum:
      type: string
      enum:
        - pyflink
        - jar
        - agent_config
        - knowledge_base
      title: FlinkJobTypeEnum
    FlinkJobStatusEnum:
      type: string
      enum:
        - CREATED
        - DEPLOYING
        - RUNNING
        - CANCELLING
        - CANCELLED
        - FAILED
        - FINISHED
      title: FlinkJobStatusEnum
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AgentSerializationEnum:
      type: string
      enum:
        - JsonConfluent
        - AvroConfluent
      title: AgentSerializationEnum
    AgentOutputSchemaTypeEnum:
      type: string
      enum:
        - STRING
        - DOUBLE
        - INT32
        - INT64
        - BOOLEAN
      title: AgentOutputSchemaTypeEnum
    AgentLlmProviderEnum:
      type: string
      enum:
        - anthropic
        - openai
        - openai-responses
        - ollama
        - azure
        - azure-openai
        - bedrock
        - qwen
        - openai-compatible
      title: AgentLlmProviderEnum
      description: >-
        Unified LLM provider enum.


        A single ``AgentLlmConnection`` row carries one provider and a set of

        capabilities (chat / embedding). ``PROVIDER_CAPABILITIES`` below pins

        which capabilities each provider can serve — picked by the FE
        Connections

        drawer and re-validated server-side on every write.
    AgentToolTypeEnum:
      type: string
      enum:
        - http
        - transform
        - mcp
      title: AgentToolTypeEnum
    AgentToolParameterConfig:
      properties:
        name:
          type: string
          maxLength: 100
          minLength: 1
          title: Name
          description: Parameter name
        type:
          type: string
          maxLength: 50
          title: Type
          description: Parameter type (string, number, boolean)
          default: string
        description:
          type: string
          maxLength: 2000
          title: Description
          description: Parameter description for the LLM
          default: ''
      additionalProperties: false
      type: object
      required:
        - name
      title: AgentToolParameterConfig
      description: A single parameter for a tool.
    AgentShortTermMemoryConfig:
      properties:
        enabled:
          type: boolean
          title: Enabled
          description: Enable short-term memory
          default: false
        ttlMs:
          type: integer
          minimum: 0
          title: Ttlms
          description: 'Time-to-live in milliseconds (default: 1 hour)'
          default: 3600000
        maxEntries:
          type: integer
          maximum: 100
          minimum: 1
          title: Maxentries
          description: Max conversation entries per key
          default: 20
      additionalProperties: false
      type: object
      title: AgentShortTermMemoryConfig
      description: Short-term (conversation) memory config.
    AgentLongTermMemoryConfig:
      properties:
        enabled:
          type: boolean
          title: Enabled
          description: Enable long-term memory
          default: false
        vectorStoreConnectionId:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Vectorstoreconnectionid
          description: >-
            Reference to a saved AgentVectorStoreConnection. Resolved at deploy
            time.
        namespace:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Namespace
          description: >-
            Per-agent namespace override (falls back to connection's
            defaultNamespace)
        destinationId:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Destinationid
          description: >-
            (Legacy) ObjectId of a Pinecone destination connector. Prefer
            vectorStoreConnectionId.
      additionalProperties: false
      type: object
      title: AgentLongTermMemoryConfig
      description: >-
        Long-term (vector store) memory config.


        References a saved ``AgentVectorStoreConnection`` by id. At deploy time

        the resolver reads the connection's ``apiKey`` + ``endpoint`` and
        composes

        the inline ``vectorStore`` block the Java runtime expects.


        Legacy agents may still carry ``destinationId`` (a Pinecone destination

        connector from the old flow). The deploy resolver handles both: if

        ``vectorStoreConnectionId`` is set it wins; otherwise it falls back to

        the legacy ``destinationId`` path. New agents created through the FE

        always use ``vectorStoreConnectionId``.
  securitySchemes:
    FronteggHTTPAuthentication:
      type: http
      scheme: bearer

````