PhariaInference API

Access and interact with Aleph Alpha models and functionality over HTTP endpoints. Provides completion, chat completions, embeddings, semantic and batch semantic embeddings, tokenization and detokenization, model listing and model settings, plus API token management. Version 4.7.0 is the version currently served by the hosted gateway at api.aleph-alpha.com.

OpenAPI Specification

aleph-alpha-pharia-inference-openapi.json Raw ↑
{
    "openapi": "3.0.3",
    "info": {
        "title": "Aleph Alpha API",
        "version": "4.7.0",
        "description": "Access and interact with Aleph Alpha models and functionality over HTTP endpoints.",
        "contact": {
            "email": "support@aleph-alpha.com"
        }
    },
    "components": {
        "securitySchemes": {
            "token": {
                "type": "http",
                "scheme": "bearer",
                "description": "Can be generated in your [Aleph Alpha profile](https://app.aleph-alpha.com/profile)"
            }
        },
        "schemas": {
            "Hosting": {
                "type": "string",
                "nullable": "true",
                "enum": [
                    "aleph-alpha",
                    "null"
                ],
                "description": "Optional parameter that specifies which datacenters may process the request.\nYou can either set the parameter to \"aleph-alpha\" or omit it (defaulting to `null`).\n\nNot setting this value, or setting it to `null`, gives us maximal flexibility in processing your request in our\nown datacenters and on servers hosted with other providers. Choose this option for maximum availability.\n\nSetting it to \"aleph-alpha\" allows us to only process the request in our own datacenters.\nChoose this option for maximal data privacy.\n"
            },
            "ResponseFormat": {
                "type": "object",
                "description": "An object specifying the format that the model must output.\nSetting to `{ \"type\": \"json_schema\" }` enables structured output mode.\n",
                "required": [
                    "type",
                    "json_schema"
                ],
                "properties": {
                    "type": {
                        "type": "string",
                        "enum": [
                            "json_schema"
                        ],
                        "description": "The type of response format. Only \"json_schema\" is currently supported."
                    },
                    "json_schema": {
                        "type": "object",
                        "description": "A JSON schema definition that the output must conform to.\nThis should follow the JSON Schema specification (https://json-schema.org/).\n",
                        "required": [
                            "name",
                            "schema"
                        ],
                        "properties": {
                            "name": {
                                "type": "string",
                                "description": "The name of the JSON schema."
                            },
                            "description": {
                                "type": "string",
                                "description": "A description of what the schema represents."
                            },
                            "strict": {
                                "type": "boolean",
                                "description": "Whether to use strict mode for schema validation.",
                                "default": "false"
                            },
                            "schema": {
                                "type": "object",
                                "description": "A JSON Schema object defining the expected output structure.\nSupports standard JSON Schema properties like type, properties, required, etc.\n",
                                "additionalProperties": "true"
                            }
                        }
                    }
                }
            },
            "MultimodalPrompt": {
                "title": "Multimodal",
                "type": "array",
                "description": "An array of prompt items for multimodal request. Can support any combination of text, images, and token ids.",
                "items": {
                    "oneOf": [
                        {
                            "$ref": "#/components/schemas/TextPromptItem"
                        },
                        {
                            "$ref": "#/components/schemas/ImagePromptItem"
                        },
                        {
                            "$ref": "#/components/schemas/TokenIdsPromptItem"
                        }
                    ]
                }
            },
            "TextPromptItem": {
                "type": "object",
                "title": "Text",
                "required": [
                    "type",
                    "data"
                ],
                "properties": {
                    "type": {
                        "type": "string",
                        "enum": [
                            "text"
                        ]
                    },
                    "data": {
                        "type": "string"
                    },
                    "controls": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "required": [
                                "start",
                                "length",
                                "factor"
                            ],
                            "properties": {
                                "start": {
                                    "type": "integer",
                                    "description": "Starting character index to apply the factor to."
                                },
                                "length": {
                                    "type": "integer",
                                    "description": "The amount of characters to apply the factor to."
                                },
                                "factor": {
                                    "type": "number",
                                    "description": "Factor to apply to the given token in the attention matrix.\n\n- 0 <= factor < 1 => Suppress the given token\n- factor == 1 => identity operation, no change to attention\n- factor > 1 => Amplify the given token\n"
                                },
                                "token_overlap": {
                                    "type": "string",
                                    "enum": [
                                        "partial",
                                        "complete"
                                    ],
                                    "default": "partial",
                                    "description": "What to do if a control partially overlaps with a text token.\n\nIf set to \"partial\", the factor will be adjusted proportionally with the amount\nof the token it overlaps. So a factor of 2.0 of a control that only covers 2 of\n4 token characters, would be adjusted to 1.5. (It always moves closer to 1, since\n1 is an identity operation for control factors.)\n\nIf set to \"complete\", the full factor will be applied as long as the control\noverlaps with the token at all.\n"
                                }
                            }
                        }
                    }
                }
            },
            "ImagePromptItem": {
                "type": "object",
                "title": "Image",
                "required": [
                    "type",
                    "data"
                ],
                "properties": {
                    "type": {
                        "type": "string",
                        "enum": [
                            "image"
                        ]
                    },
                    "data": {
                        "type": "string",
                        "description": "An image send as part of a prompt to a model. The image is represented as base64.\n\nNote: The models operate on square images. All non-square images are center-cropped\nbefore going to the model, so portions of the image may not be visible.\n\nYou can supply specific cropping parameters if you like, to choose a different area\nof the image than a center-crop. Or, you can always transform the image yourself to\na square before sending it.\n"
                    },
                    "x": {
                        "type": "integer",
                        "description": "x-coordinate of top left corner of cropping box in pixels"
                    },
                    "y": {
                        "type": "integer",
                        "description": "y-coordinate of top left corner of cropping box in pixels"
                    },
                    "size": {
                        "type": "integer",
                        "description": "Size of the cropping square in pixels"
                    },
                    "controls": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "required": [
                                "rect",
                                "factor"
                            ],
                            "properties": {
                                "rect": {
                                    "type": "object",
                                    "required": [
                                        "left",
                                        "top",
                                        "width",
                                        "height"
                                    ],
                                    "description": "Bounding box in logical coordinates. From 0 to 1. With (0,0) being the upper left corner,\nand relative to the entire image.\n\nKeep in mind, non-square images are center-cropped by default before going to the model. (You\ncan specify a custom cropping if you want.). Since control coordinates are relative to the\nentire image, all or a portion of your control may be outside the \"model visible area\".\n",
                                    "properties": {
                                        "left": {
                                            "type": "number",
                                            "description": "x-coordinate of top left corner of the control bounding box.\nMust be a value between 0 and 1, where 0 is the left corner and 1 is the right corner.\n"
                                        },
                                        "top": {
                                            "type": "number",
                                            "description": "y-coordinate of top left corner of the control bounding box\nMust be a value between 0 and 1, where 0 is the top pixel row and 1 is the bottom row.\n"
                                        },
                                        "width": {
                                            "type": "number",
                                            "description": "width of the control bounding box\nMust be a value between 0 and 1, where 1 means the full width of the image.\n"
                                        },
                                        "height": {
                                            "type": "number",
                                            "description": "height of the control bounding box\nMust be a value between 0 and 1, where 1 means the full height of the image.\n"
                                        }
                                    }
                                },
                                "factor": {
                                    "type": "number",
                                    "description": "Factor to apply to the given token in the attention matrix.\n\n- 0 <= factor < 1 => Suppress the given token\n- factor == 1 => identity operation, no change to attention\n- factor > 1 => Amplify the given token\n"
                                },
                                "token_overlap": {
                                    "type": "string",
                                    "enum": [
                                        "partial",
                                        "complete"
                                    ],
                                    "default": "partial",
                                    "description": "What to do if a control partially overlaps with an image token.\n\nIf set to \"partial\", the factor will be adjusted proportionally with the amount\nof the token it overlaps. So a factor of 2.0 of a control that only covers half\nof the image \"tile\", would be adjusted to 1.5. (It always moves closer to 1, since\n1 is an identity operation for control factors.)\n\nIf set to \"complete\", the full factor will be applied as long as the control\noverlaps with the token at all.\n"
                                }
                            }
                        }
                    }
                }
            },
            "TokenIdsPromptItem": {
                "type": "object",
                "title": "Token Ids",
                "required": [
                    "type",
                    "data"
                ],
                "properties": {
                    "type": {
                        "type": "string",
                        "enum": [
                            "token_ids"
                        ]
                    },
                    "data": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "controls": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "required": [
                                "index",
                                "factor"
                            ],
                            "properties": {
                                "index": {
                                    "type": "integer",
                                    "description": "Index of the token, relative to the list of tokens IDs in the current prompt item.\n"
                                },
                                "factor": {
                                    "type": "number",
                                    "description": "Factor to apply to the given token in the attention matrix.\n\n- 0 <= factor < 1 => Suppress the given token\n- factor == 1 => identity operation, no change to attention\n- factor > 1 => Amplify the given token\n"
                                }
                            }
                        }
                    }
                }
            },
            "Prompt": {
                "description": "This field is used to send prompts to the model.\nA prompt can either be a text prompt or a multimodal prompt.\nA text prompt is a string of text.\nA multimodal prompt is an array of prompt items. It can be a combination of text,\nimages, and token ID arrays.\n\nIn the case of a multimodal prompt, the prompt items will be concatenated and a single\nprompt will be used for the model.\n\nTokenization:\n  - Token ID arrays are used as as-is.\n  - Text prompt items are tokenized using the tokenizers specific to the model.\n  - Each image is converted into 144 tokens.\n",
                "oneOf": [
                    {
                        "title": "Text Prompt",
                        "type": "string",
                        "description": "The text to be completed. Unconditional completion can be started with an empty string (default). The prompt may contain a zero shot or few shot task."
                    },
                    {
                        "$ref": "#/components/schemas/MultimodalPrompt"
                    }
                ]
            },
            "OptimizedPrompt": {
                "description": "Describes prompt after optimizations. This field is only returned if the flag `disable_optimizations` flag is not set and the prompt has actually changed.",
                "type": "array",
                "items": {
                    "oneOf": [
                        {
                            "type": "object",
                            "title": "Text",
                            "properties": {
                                "type": {
                                    "type": "string",
                                    "enum": [
                                        "text"
                                    ]
                                },
                                "data": {
                                    "type": "string"
                                }
                            }
                        },
                        {
                            "type": "object",
                            "title": "Image",
                            "properties": {
                                "type": {
                                    "type": "string",
                                    "enum": [
                                        "image"
                                    ]
                                },
                                "data": {
                                    "type": "string",
                                    "description": "base64 encoded image"
                                }
                            }
                        },
                        {
                            "type": "object",
                            "title": "Token Ids",
                            "properties": {
                                "type": {
                                    "type": "string",
                                    "enum": [
                                        "token_ids"
                                    ]
                                },
                                "data": {
                                    "type": "array",
                                    "items": {
                                        "type": "integer"
                                    }
                                }
                            }
                        }
                    ]
                }
            },
            "CompletionRequest": {
                "type": "object",
                "example": {
                    "model": "llama-3.1-8b-instruct",
                    "prompt": "An apple a day"
                },
                "properties": {
                    "model": {
                        "type": "string",
                        "description": "The name of the model.\nModels and their respective architectures can differ in parameter size and capabilities.\nThe most recent version of the model is always used. The model output contains information as to the model version.\n"
                    },
                    "hosting": {
                        "$ref": "#/components/schemas/Hosting"
                    },
                    "prompt": {
                        "$ref": "#/components/schemas/Prompt"
                    },
                    "maximum_tokens": {
                        "type": "integer",
                        "nullable": "true",
                        "description": "The maximum number of tokens to be generated. Completion will terminate after the maximum number of tokens is\nreached.\n\nIncrease this value to generate longer texts. A text is split into tokens. Usually there are more\ntokens than words. The sum of input tokens and maximum_tokens may not exceed the model's context window size.\n"
                    },
                    "minimum_tokens": {
                        "type": "integer",
                        "default": "0",
                        "description": "Generate at least this number of tokens before an end-of-text token is generated."
                    },
                    "echo": {
                        "type": "boolean",
                        "default": "false",
                        "description": "Echo the prompt in the completion. This may be especially helpful when log_probs is set to return logprobs for the prompt.\n"
                    },
                    "temperature": {
                        "type": "number",
                        "default": "0.0",
                        "nullable": "true",
                        "description": "A higher sampling temperature encourages the model to produce less probable outputs (\"be more creative\"). Values are expected in a range from 0.0 to 1.0. Try high values (e.g., 0.9) for a more \"creative\" response and the default 0.0 for a well defined and repeatable answer. It is advised to use either temperature, top_k, or top_p, but not all three at the same time. If a combination of temperature, top_k or top_p is used, rescaling of logits with temperature will be performed first. Then top_k is applied. Top_p follows last."
                    },
                    "top_k": {
                        "type": "integer",
                        "default": "0",
                        "nullable": "true",
                        "description": "Introduces random sampling for generated tokens by randomly selecting the next token from the k most likely options. A value larger than 1 encourages the model to be more creative. Set to 0.0 if repeatable output is desired. It is advised to use either temperature, top_k, or top_p, but not all three at the same time. If a combination of temperature, top_k or top_p is used, rescaling of logits with temperature will be performed first. Then top_k is applied. Top_p follows last."
                    },
                    "top_p": {
                        "type": "number",
                        "default": "0.0",
                        "nullable": "true",
                        "description": "Introduces random sampling for generated tokens by randomly selecting the next token from the smallest possible set of tokens whose cumulative probability exceeds the probability top_p. Set to 0.0 if repeatable output is desired. It is advised to use either temperature, top_k, or top_p, but not all three at the same time. If a combination of temperature, top_k or top_p is used, rescaling of logits with temperature will be performed first. Then top_k is applied. Top_p follows last."
                    },
                    "presence_penalty": {
                        "type": "number",
                        "default": "0.0",
                        "nullable": "true",
                        "description": "The presence penalty reduces the likelihood of generating tokens that are already present in the\ngenerated text (`repetition_penalties_include_completion=true`) respectively the prompt (`repetition_penalties_include_prompt=true`).\nPresence penalty is independent of the number of occurrences. Increase the value to reduce the likelihood of repeating text.\nAn operation like the following is applied:\n\n    logits[t] -> logits[t] - 1 * penalty\n\nwhere `logits[t]` is the logits for any given token. Note that the formula is independent of the number of times\nthat a token appears.\n"
                    },
                    "frequency_penalty": {
                        "type": "number",
                        "default": "0.0",
                        "nullable": "true",
                        "description": "The frequency penalty reduces the likelihood of generating tokens that are already present in the\ngenerated text (`repetition_penalties_include_completion=true`) respectively the prompt (`repetition_penalties_include_prompt=true`).\nIf `repetition_penalties_include_prompt=True`, this also includes the tokens in the prompt.\nFrequency penalty is dependent on the number of occurrences of a token.\nAn operation like the following is applied:\n\n    logits[t] -> logits[t] - count[t] * penalty\n\nwhere `logits[t]` is the logits for any given token and `count[t]` is the number of times that token appears.\n"
                    },
                    "sequence_penalty": {
                        "type": "number",
                        "default": "0.0",
                        "description": "Increasing the sequence penalty reduces the likelihood of reproducing token sequences that already appear in the prompt\n(if repetition_penalties_include_prompt is True) and prior completion.\n"
                    },
                    "sequence_penalty_min_length": {
                        "type": "integer",
                        "default": "2",
                        "description": "Minimal number of tokens to be considered as sequence\n"
                    },
                    "repetition_penalties_include_prompt": {
                        "type": "boolean",
                        "default": "false",
                        "nullable": "true",
                        "description": "Flag deciding whether presence penalty or frequency penalty are updated from tokens in the prompt"
                    },
                    "repetition_penalties_include_completion": {
                        "type": "boolean",
                        "default": "true",
                        "description": "Flag deciding whether presence penalty or frequency penalty are updated from tokens in the completion"
                    },
                    "use_multiplicative_presence_penalty": {
                        "type": "boolean",
                        "default": "false",
                        "nullable": "true",
                        "description": "Flag deciding whether presence penalty is applied multiplicatively (True) or additively (False). This changes the formula stated for presence penalty."
                    },
                    "use_multiplicative_frequency_penalty": {
                        "type": "boolean",
                        "default": "false",
                        "description": "Flag deciding whether frequency penalty is applied multiplicatively (True) or additively (False). This changes the formula stated for frequency penalty."
                    },
                    "use_multiplicative_sequence_penalty": {
                        "type": "boolean",
                        "default": "false",
                        "description": "Flag deciding whether sequence penalty is applied multiplicatively (True) or additively (False)."
                    },
                    "penalty_bias": {
                        "type": "string",
                        "nullable": "true",
                        "default": "null",
                        "description": "All tokens in this text will be used in addition to the already penalized tokens for repetition penalties. These consist of the already generated completion tokens and the prompt tokens, if `repetition_penalties_include_prompt` is set to `true`.\n"
                    },
                    "penalty_exceptions": {
                        "type": "array",
                        "nullable": "true",
                        "items": {
                            "type": "string"
                        },
                        "description": "List of strings that may be generated without penalty, regardless of other penalty settings.\nBy default, we will also include any `stop_sequences` you have set, since completion performance can be degraded if expected stop sequences are penalized.\nYou can disable this behavior by setting `penalty_exceptions_include_stop_sequences` to `false`.\n"
                    },
                    "penalty_exceptions_include_stop_sequences": {
                        "type": "boolean",
                        "default": "true",
                        "nullable": "true",
                        "description": "By default we include all `stop_sequences` in `penalty_exceptions`, so as not to penalise the presence of stop sequences that are present in few-shot prompts to give structure to your completions.\n\nYou can set this to `false` if you do not want this behaviour.\n\nSee the description of `penalty_exceptions` for more information on what `penalty_exceptions` are used for.\n"
                    },
                    "best_of": {
                        "type": "integer",
                        "nullable": "true",
                        "default": "1",
                        "maximum": "100",
                        "description": "If a value is given, the number of `best_of` completions will be generated on the server side. The completion with the highest log probability per token is returned. If the parameter `n` is greater than 1 more than 1 (`n`) completions will be returned. `best_of` must be strictly greater than `n`."
                    },
                    "n": {
                        "type": "integer",
                        "default": "1",
                        "nullable": "true",
                        "description": "The number of completions to return. If argmax sampling is used (temperature, top_k, top_p are all default) the same completions will be produced. This parameter should only be increased if random sampling is used."
                    },
                    "logit_bias": {
                        "type": "object",
                        "nullable": "true"
                    },
                    "log_probs": {
                        "type": "integer",
                        "default": "null",
                        "nullable": "true",
                        "minimum": "0",
                        "maximum": "20",
                        "description": "Number of top log probabilities for each token generated. Log probabilities can be used in downstream tasks or to assess the model's certainty when producing tokens. No log probabilities are returned if set to None. Log probabilities of generated tokens are returned if set to 0. Log probabilities of generated tokens and top n log probabilities are returned if set to n."
                    },
                    "stop_sequences": {
                        "type": "array",
                        "nullable": "true",
                        "description": "List of strings that will stop generation if they're generated. Stop sequences may be helpful in structured texts. Say the user has specified \"tor away\" as one of the requested stop sequences and the model has generated the following sequence of tokens [\"An\", \" apple\", \" a\", \" day\", \" keeps\", \" the\", \" doctor\", \" away\"]. The user will see \"An apple a day keeps the\" as the model's response, omitting the last two tokens which contain the stop sequence. Note that even though \" doc\" is not part of the stop sequence \"tor away\", it won't appear in the user output since it is part of the token \" doctor\" which contains part of the stop sequence.\n",
                        "items": {
                            "type": "string"
                        }
                    },
                    "tokens": {
                        "type": "boolean",
                        "default": "false",
                        "nullable": "true",
                        "description": "Flag indicating whether individual tokens of the completion should be returned (True) or whether solely the generated text (i.e. the completion) is sufficient (False)."
                    },
                    "raw_completion": {
                        "type": "boolean",
                        "default": "false",
                        "description": "Setting this parameter to true forces the raw completion of the model to be returned.\nFor some models, we may optimize the completion that was generated by the model and\nreturn the optimized completion in the completion field of the `CompletionResponse`.\nThe raw completion, if returned, will contain the un-optimized completion.\nSetting tokens to true or log_probs to any value will also trigger the raw completion\nto be returned.\n"
                    },
                    "disable_optimizations": {
                        "type": "boolean",
                        "default": "false",
                        "nullable": "true",
                        "description": "We continually research optimal ways to work with our models. By default, we apply these optimizations to both your prompt and completion for you.\nOur goal is to improve your results while using our API. But you can always pass `disable_optimizations: true` and we will leave your prompt and completion untouched.\n"
                    },
                    "completion_bias_inclusion": {
                        "type": "array",
                        "items": {
                            "type": "string"
    

# --- truncated at 32 KB (206 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/aleph-alpha/refs/heads/main/openapi/aleph-alpha-pharia-inference-openapi.json
Where this information came from

This is an independent, third-party profile of PhariaInference API, published by API Evangelist. We do not operate, host, resell, or support these APIs, and we are not affiliated with or endorsed by the company unless stated above. Everything here is built from publicly available information — the company's own site, developer portal, documentation, public repositories, and the specifications it publishes for public use. Nothing is obtained by breaching a system, defeating an access control, or using credentials.

The Kin Score and Agent Readiness rating are independently calculated assessments of a company's public API artifacts, scored against a published rubric. They are not certifications, endorsements, security assessments, or audits.

Corrections, re-scores, and removal are free — no partnership or purchase required, and you do not need to justify the request. A removed company is recorded as unrated, never scored zero for having asked. Acknowledgement within one business day; removal within two.

info@apievangelist.com · Read the full data-sourcing policy →
On a security or compliance team? Put security in the subject line and you will get a person, not a form — we will tell you exactly which public URLs this profile was built from.