JavaScript
import PromptFoundry from '@prompt-foundry/typescript-sdk';
const client = new PromptFoundry({
apiKey: process.env['PROMPT_FOUNDRY_API_KEY'], // This is the default and can be omitted
});
async function main() {
const response = await client.prompts.getParameters('1212121');
console.log(response);
}
main();import os
from prompt_foundry_python_sdk import PromptFoundry
client = PromptFoundry(
# This is the default and can be omitted
api_key=os.environ.get("PROMPT_FOUNDRY_API_KEY"),
)
response = client.prompts.get_parameters(
id="1212121",
)
print(response)curl --request POST \
--url https://api.promptfoundry.ai/sdk/v1/prompts/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"variables": {},
"overrideMessages": [
{
"content": [
{
"type": "TEXT",
"text": "<string>"
}
]
}
],
"appendMessages": [
{
"content": [
{
"type": "TEXT",
"text": "<string>"
}
]
}
],
"user": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.promptfoundry.ai/sdk/v1/prompts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'variables' => [
],
'overrideMessages' => [
[
'content' => [
[
'type' => 'TEXT',
'text' => '<string>'
]
]
]
],
'appendMessages' => [
[
'content' => [
[
'type' => 'TEXT',
'text' => '<string>'
]
]
]
],
'user' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.promptfoundry.ai/sdk/v1/prompts/{id}"
payload := strings.NewReader("{\n \"variables\": {},\n \"overrideMessages\": [\n {\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"appendMessages\": [\n {\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"user\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.promptfoundry.ai/sdk/v1/prompts/{id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"variables\": {},\n \"overrideMessages\": [\n {\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"appendMessages\": [\n {\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"user\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.promptfoundry.ai/sdk/v1/prompts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"variables\": {},\n \"overrideMessages\": [\n {\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"appendMessages\": [\n {\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"user\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"provider": "anthropic",
"name": "<string>",
"parameters": {
"max_tokens": 123,
"messages": [
{
"content": "<string>",
"role": "user"
}
],
"model": "<string>",
"stream": false,
"metadata": {
"user_id": "<string>"
},
"stop_sequences": [
"<string>"
],
"system": "<string>",
"temperature": 123,
"tool_choice": {
"type": "auto"
},
"tools": [
{
"input_schema": {
"type": "object",
"properties": null
},
"name": "<string>",
"description": "<string>"
}
],
"top_k": 123,
"top_p": 123
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}API Reference
Get Model Parameters
Fetches the configured model parameters and messages rendered with the provided variables mapped to the set LLM provider. This endpoint abstracts the need to handle mapping between different providers, while still allowing direct calls to the providers.
POST
/
sdk
/
v1
/
prompts
/
{id}
JavaScript
import PromptFoundry from '@prompt-foundry/typescript-sdk';
const client = new PromptFoundry({
apiKey: process.env['PROMPT_FOUNDRY_API_KEY'], // This is the default and can be omitted
});
async function main() {
const response = await client.prompts.getParameters('1212121');
console.log(response);
}
main();import os
from prompt_foundry_python_sdk import PromptFoundry
client = PromptFoundry(
# This is the default and can be omitted
api_key=os.environ.get("PROMPT_FOUNDRY_API_KEY"),
)
response = client.prompts.get_parameters(
id="1212121",
)
print(response)curl --request POST \
--url https://api.promptfoundry.ai/sdk/v1/prompts/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"variables": {},
"overrideMessages": [
{
"content": [
{
"type": "TEXT",
"text": "<string>"
}
]
}
],
"appendMessages": [
{
"content": [
{
"type": "TEXT",
"text": "<string>"
}
]
}
],
"user": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.promptfoundry.ai/sdk/v1/prompts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'variables' => [
],
'overrideMessages' => [
[
'content' => [
[
'type' => 'TEXT',
'text' => '<string>'
]
]
]
],
'appendMessages' => [
[
'content' => [
[
'type' => 'TEXT',
'text' => '<string>'
]
]
]
],
'user' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.promptfoundry.ai/sdk/v1/prompts/{id}"
payload := strings.NewReader("{\n \"variables\": {},\n \"overrideMessages\": [\n {\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"appendMessages\": [\n {\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"user\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.promptfoundry.ai/sdk/v1/prompts/{id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"variables\": {},\n \"overrideMessages\": [\n {\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"appendMessages\": [\n {\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"user\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.promptfoundry.ai/sdk/v1/prompts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"variables\": {},\n \"overrideMessages\": [\n {\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"appendMessages\": [\n {\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"<string>\"\n }\n ]\n }\n ],\n \"user\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"provider": "anthropic",
"name": "<string>",
"parameters": {
"max_tokens": 123,
"messages": [
{
"content": "<string>",
"role": "user"
}
],
"model": "<string>",
"stream": false,
"metadata": {
"user_id": "<string>"
},
"stop_sequences": [
"<string>"
],
"system": "<string>",
"temperature": 123,
"tool_choice": {
"type": "auto"
},
"tools": [
{
"input_schema": {
"type": "object",
"properties": null
},
"name": "<string>",
"description": "<string>"
}
],
"top_k": 123,
"top_p": 123
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Body
application/json
Was this page helpful?