Saltar al contenido

Bibliotecas de cliente

El cliente oficial es onetime-ruby, que admite las versiones v1 y v2 de la API, todos los dominios regionales y URL base personalizadas.

Todo lo demás en esta página es mantenido por la comunidad. La mayoría de estas bibliotecas son anteriores a la API v2 y a los dominios regionales, por lo que normalmente llaman a los puntos de conexión obsoletos de v1 en onetimesecret.com: consulte la nota de estado de cada entrada y compruebe que la biblioteca funciona con su región o su instancia autoalojada antes de depender de ella.

Lenguaje Biblioteca Última actividad¹ Dominio regional / personalizado
Ruby onetime-ruby (oficial) 2026-06 ✅ todas las regiones + URL base personalizada
Go go-onetimesecret 2026-05 host de EE. UU.
Python onetimesecret-cli 2024-11 opción de región EE. UU. / UE
Go otsgo 2024-03 sin documentar
PowerShell OneTimeSecret 2021-06 URL base personalizada
Bash onetimesecret-bash 2020-05 host personalizado
Python py_onetimesecret 2019-05 ❌ (de la época de Python 2)
C# OneTimeSharp 2018-05 ❌
Java onetime-java 2014-06 solo URL autoalojada
Perl Net::OneTimeSecret 2012-02 ❌

¹ Último commit o versión publicada en el momento de la última auditoría (2026-07).

Página de GitHub - onetime-ruby por Delano: cliente oficial, con mantenimiento activo (último commit 2026-06). Admite la API v1 (obsoleta) y v2, dominios regionales y URL base personalizadas. Requiere Ruby 3.1+ y no tiene dependencias en tiempo de ejecución.

require 'onetime/api'
api = Onetime::API.new('YOUR_EMAIL', 'YOUR_OTS_APIKEY')
options = {
secret: 'Jazz, jazz and more jazz.',
recipient: 'example@onetimesecret.com',
ttl: 7200
}
ret = api.post('/share', options)
puts ret['secret_key']

Página de GitHub - onetimesecret-cli por slashpass: mantenido por la comunidad (último commit 2024-11). Admite una opción de región (us / eu).

from onetimesecret import OneTimeSecretCli
cli = OneTimeSecretCli(ONETIMESECRET_USER, ONETIMESECRET_KEY)
cli.create_link("secret") # return a link like https://onetimesecret.com/secret/xxxxxxxxxxx

Página de GitHub - py_onetimesecret por Vladislav Stepanov: sin mantenimiento (último commit en 2019; el ejemplo siguiente es de Python 2). Usa la API v1 obsoleta solo con onetimesecret.com.

from onetimesecret import OneTimeSecret
o = OneTimeSecret("YOUR_EMAIL", "YOUR_OTS_APIKEY")
secret = o.share(u"test")
print o.retrieve_secret(secret["secret_key"])
# {u'secret_key': u'dtr7ixukiolpx1i4i87kahmhyoy2q65',
# u'value': u'test'}

Net::OneTimeSecret en CPAN por Kyle Dawkins: sin mantenimiento (última versión 0.04, 2012-02). Es anterior a la API v2 y a los dominios regionales.

#!/usr/bin/env perl
use Net::OneTimeSecret;
# Note: replace these with yours in order for this to work!
my $customerId = 'YOUR_EMAIL';
my $testApiKey = 'YOUR_OTS_APIKEY';
my $api = Net::OneTimeSecret->new( $customerId, $testApiKey );
my $result = $api->shareSecret( 'Jazz, jazz and more jazz.',
passphrase => 'thepassword',
recipient => 'kyle@shoffle.com',
ttl => 7200,
);
printf( "%s\n", $result->{secret_key} );
my $secret = $api->retrieveSecret( $result->{secret_key}, passphrase => "thepassword" );
printf( "%s\n", $secret->{value} );

Página de GitHub - onetime-java por Marcin Pawlowski: sin mantenimiento (último commit 2014-06). Acepta la URL de una instancia, por lo que puede funcionar en instalaciones autoalojadas, pero es anterior a la API v2.

OneTimeSecret ots = new OneTimeSecretRestImpl(
"https://path/to/ots/instance",
"ots-username",
"ots-apikey");
GenerateResponse generateResponse = ots.generate(
new GenerateRequest.Builder()
.withPassphrase("supersecret")
.build());
RetrieveResponse retrieveResponse = ots.retrieve(
new RetrieveRequest.Builder()
.withSecretKey(generateResponse.getSecretKey())
.withPassphrase("supersecret")
.build());
assertEquals(generateResponse.getValue(), retrieveResponse.getValue());

Página de GitHub - OneTimeSharp por Vladislav Stepanov: sin mantenimiento (último commit 2018-05). Usa la API v1 obsoleta solo con onetimesecret.com.

// You can use OneTimeSharp in any of your projects which are compatible with .NET (4.0+) or Mono (2.10.8+).
using VStepanov.OneTimeSharp;
class Test
{
static void Main(string[] args)
{
var ots = new OneTimeSecret("YOUR_EMAIL", "YOUR_OTS_APIKEY");
var generated = ots.GenerateSecret();
Console.WriteLine(generated.Value); // LR*?us*A(UT*
Console.WriteLine(generated.SecretKey); // ikzx3m77j5by8411cg5lk5fvfylvl0i
Console.WriteLine(ots.GetSecretLink(generated)); // https://onetimesecret.com/secret/ikzx3m77j5by8411cg5lk5fvfylvl0i
var shared = ots.ShareSecret("Hello, OTS!");
Console.WriteLine(shared.MetadataKey); // kd6rgsucl98qbgu9eavjq4k5sdxsom0
Console.WriteLine(ots.GetMetadataLink(shared)); // https://onetimesecret.com/private/kd6rgsucl98qbgu9eavjq4k5sdxsom0
}
}

Página de GitHub - go-onetimesecret por Corbalt: mantenido por la comunidad (último commit 2026-05, actualizado para el host us.onetimesecret.com). Incluye una CLI.

import ots "github.com/corbaltcode/go-onetimesecret"
client := ots.Client{
Username: "user@example.com",
Key: "my api key",
}
metadata, err := client.Put("the launch codes", "passphrase", 0, "")
if err != nil {
// handle error
}
secret, err := client.Get(metadata.SecretKey, "passphrase")
if err != nil {
// handle error
}
// prints "the launch codes"
print(secret)
Ventana de terminal
$ go install github.com/corbaltcode/go-onetimesecret/cmd/ots@latest
$ ots put 'what is essential is invisible to the eye'
hdjk6p0ozf61o7n6pbaxy4in8zuq7sm ifipvdpeo8oy6r8ryjbu8y7rhm9kty9
$ ots get hdjk6p0ozf61o7n6pbaxy4in8zuq7sm
what is essential is invisible to the eye
$ ots gen
rVjbS$twCJkS 4nwhy7v4fnabayqc5auv4ogh0nfr20 flsdlaun6hwczqu9utmc0vts5xj9xu1
$ ots burn flsdlaun6hwczqu9utmc0vts5xj9xu1
flsdlaun6hwczqu9utmc0vts5xj9xu1

Página de GitHub - otsgo por Emídio Neto: mantenido por la comunidad (última versión v1.1.0, 2024-03). La compatibilidad con dominios regionales no está documentada.

// Build a new client
client := ots.NewClient(
WithUsername("otsuser@domain.com"),
WithApiKey("xxxxxxxx"),
)
// Send a request with context
ctx := context.Background()
response, err := client.GetStatus(ctx)
if err != nil {
panic(err)
}
fmt.Println(response.Status)

Página de GitHub - OneTimeSecret por Craig Gumbley: sin mantenimiento (última versión 2021-06). Admite un -BaseUrl personalizado, por lo que puede apuntar a una región o a una instancia autoalojada, pero es anterior a la API v2.

Ventana de terminal
# Install from the PowerShell gallery
Install-Module -Name OneTimeSecret -Scope CurrentUser
# Set connection information
Set-OTSAuthorizationToken -Username user@mail.com -APIKey xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Generate a new shared secret
New-OTSSharedSecret -Secret "Very Secret" -Passphrase 1234 -Recipient user@mail.com
# Retrieve a secret
Get-OTSSecret -SecretKey qqevnp70b4uoiax4knzhwlhros6ne7x -Passphrase 1234
# View all functions that are available
Get-Command -Module OneTimeSecret | Select Name

Página de GitHub - onetimesecret-bash por Eric Engstrom: sin mantenimiento (último commit 2020-05). Admite un host personalizado mediante ots_set_host, pero es anterior a la API v2 y a los dominios regionales.

Ventana de terminal
# source for use anonymously (secrets created anonymously)
source ots.bash
# or, source with specific auth credentials
APIUSER="USERNAME"
APIKEY="APIKEY"
source ots.bash -u $APIUSER -k $APIKEY
# check status of server
ots_status
# create a secret and get back the URL
URL=$(echo "secret" | ots_share)
# share a multi line secret via HEREDOC.
URL=$(ots_share <<-EOF
This is a Secret
... on multiple lines
EOF
)
# pass options to share or generate.
URL=$(ots_share ttl=600 \
passphrase="shared-secret" \
recipient="someone@somewhere.com" <<< "SECRET")
# fetch the secret data
local DATA="$(ots_retrieve "$URL")"
# share/generate a new secret, and get back the private metadata key
local KEY=$(ots_metashare <<< "SECRET")
local KEY=$(ots_metagenerate)
# get a list of private metadata keys recently created.
# note that this requires valid authentication credentials
local -a RECENT=( $(ots_recent) )
# check on the current state of a secret, given the private key
ots_state $KEY
# burn a secret, given the private key
ots_burn $KEY
Ventana de terminal
# Share a secret (from stdin)
./ots share
SECRET
^D
# Share a secret (via HEREDOC)
./ots share <<-EOF
This is a multi-line secret via HEREDOC.
Something else goes here.
EOF
# Get/Retrieve a secret:
./ots get <key|url>
./ots retrieve <key|url>
# Burn a secret, given its private metadata key:
./ots burn <key>